Intermec PM23c Fingerprint Developer's Guide (PC23d, PC43d/t, PM23c, PM43, PM4 - Page 66
Retrieving Buffer Status With LOC or LOF
View all Intermec PM23c manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 66 highlights
Chapter 4 - Managing Input and Output To temporarily turn off background reception during some part of the program execution, issue a COMSET OFF statement, and then turn reception on again using a new COMSET ON statement. Note: Because COMSET ON/OFF statements empty the buffer, use COMBUF$ to read the buffer contents first. 6 Add a few lines to print the content of the buffer (line 1060) and create a loop that waits from input from the host (line 90). The entire example looks like this: NEW 10 COM ERROR 1 ON 20 A$="Max. number of char. received" 30 B$="End char. received" 40 C$="Attn. string received" 50 D$="Communication error" 60 COMSET 1, "A",CHR$(90),"#","BREAK",20 70 ON COMSET 1 GOSUB 1000 80 COMSET 1 ON 90 IF QDATA$="" THEN GOTO 90 100 END 1000 QDATA$=COMBUF$(1) 1010 Q% = COMSTAT (1) 1020 IF Q% AND 2 THEN PRINT A$ 1030 IF Q% AND 4 THEN PRINT B$ 1040 IF Q% AND 8 THEN PRINT C$ 1050 IF Q% AND 32 THEN PRINT D$ 1060 PRINT QDATA$ 1070 RETURN RUN 7 You can test the example by pressing Enter on the host keyboard. Then enter various characters and see what happens, starting with the start character, stop character, ignore character, attention string, and maximum number of characters parameters in the COMSET statement. Retrieving Buffer Status With LOC or LOF LOC and LOF return the status of the receive or transmitter buffers in an OPENed communication channel. If the channel is OPENed for INPUT: • LOC returns the remaining number of characters to be read from the receive buffer. • LOF returns the remaining free space (in bytes) in the receive buffer. If the channel is OPENed for OUTPUT: • LOC returns the remaining free space (bytes) in the transmitter buffer. • LOF returns the remaining number of characters to be transmitted from the transmitter buffer. 54 Fingerprint Developer's Guide