Programming instructions

Intermec Fingerprint v7.61 Programmers Reference Manual Ed. 750
Chapter 2 Program Instructions
COMSTAT
Field of Application
Function reading the status of the buffer of a communication channel.
Syntax COMSTAT(<nexp>)
<nexp> is one of the following communication channels:
1 = "uart1:"
2 = "uart2:"
3 = "uart3:"
4 = "centronics:"
5 = "net1:"
6 = "usb1:"
Remarks
This function is closely related to COMSET, ON COMSET GOSUB,
COMSET ON, COMSET OFF, COM ERROR ON/OFF, and COMBUF$.
It allows you to nd out if the buffer is able to receive background data, or-
if not-what condition has caused the interruption.
The buffers status is indicated by a numeric expression, which is the sum
of the values given by the following conditions:
Copy of hardware handshake bit (not on "net1:" or "usb1:") .........0 or 1
Interruption: Max. number of characters received...................................2
Interruption: End character received.........................................................4
Interruption: Attention string received......................................................8
Interruption: Communication error (not on "net1:" or "usb1:")........... 32
Example
A message will appear on the screen when the reception is interrupted by
any of four COMSET conditions being ful lled:
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 IF COMSTAT(1) AND 2 THEN PRINT A$
1020 IF COMSTAT(1) AND 4 THEN PRINT B$
1030 IF COMSTAT(1) AND 8 THEN PRINT C$
1040 IF COMSTAT(1) AND 32 THEN PRINT D$
1050 PRINT QDATA$
1060 RETURN