17.08.2013 Views

Contents, cont'd. - Intermec

Contents, cont'd. - Intermec

Contents, cont'd. - Intermec

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

COMSTAT<br />

Chapter 2 Program Instructions<br />

Field of Application Function reading the status of the buffer of a communication channel.<br />

Syntax COMSTAT()<br />

is one of the following communication channels:<br />

1 = "uart1:"<br />

2 = "uart2:"<br />

3 = "uart3:"<br />

4 = "centronics:"<br />

Remarks This function is closely related to COMSET, ON COMSET GOSUB,<br />

COMSET ON, COMSET OFF, COM ERROR ON/OFF and COMBUF$.<br />

It allows you to find out if the buffer is able to receive background data, or –<br />

if not – what condition has caused the interruption.<br />

The buffer's status is indicated by a numeric expression, which is the sum of<br />

the values given by the following conditions:<br />

• Copy of hardware handshake bit .................................................. 0 or 1<br />

• Interruption: Max. number of characters received ................................ 2<br />

• Interruption: End character received .................................................... 4<br />

• Interruption: Attention string received ................................................. 8<br />

• Interruption: Communication error.................................................... 32<br />

Example A message will appear on the screen when the reception is interrupted by any<br />

of four COMSET conditions being fulfilled:<br />

10 COM ERROR 1 ON<br />

20 A$="Max. number of char. received"<br />

30 B$="End char. received"<br />

40 C$="Attn. string received"<br />

50 D$="Communication error"<br />

60 COMSET 1, "A",CHR$(90),"#","BREAK",20<br />

70 ON COMSET 1 GOSUB 1000<br />

80 COMSET 1 ON<br />

90 IF QDATA$="" THEN GOTO 90<br />

100 END<br />

1000 QDATA$=COMBUF$(1)<br />

1010 IF COMSTAT(1) AND 2 THEN PRINT A$<br />

1020 IF COMSTAT(1) AND 4 THEN PRINT B$<br />

1030 IF COMSTAT(1) AND 8 THEN PRINT C$<br />

1040 IF COMSTAT(1) AND 32 THEN PRINT D$<br />

1050 PRINT QDATA$<br />

1060 RETURN<br />

<strong>Intermec</strong> Fingerprint 7.2 – Reference Manual Ed. 3 47

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!