Programming instructions

74
Intermec Fingerprint 6.13 – Programmer's Guide
7. INPUT TO FINGERPRINT, cont'd.
8. Background
Communication, cont'd.
Continued!
It may be useful to create a few messages indicating what have
caused the interruption.
Example:
Error handling is enabled for communication channel "uart1:"
and messages will be printed to the standard out channel for all
conditions that can be detected by a COMSTAT function.
10 COM ERROR 1 ON
20 A$="Max. number of characters"
30 B$="End char. received"
40 C$="Communication error"
50 D$="Attention string received"
Continue with a COMSET statement specifying:
- Which communication channel will be used (0–4, see above).
- Which character, or string of characters, will be used to tell the
printer to start receiving data?
- Which character, or string of characters, will be used to tell the
printer to stop receiving data?
- Which character or characters should be ignored, i.e. filtered out
from the received data?
- Which character, or string of characters, should be used as an
attention string, i.e. to interrupt the reception.
Start, stop, ignore and attention characters are selected
according to the protocol of the computing device that transmits
the data. Non printable characters, e.g. STX (Start of Text;
ASCII 02 dec.) and ETX (End of Text; ASCII 03 dec.) can be
selected by means of a CHR$ function. To specify no character,
use an empty string, i.e. "".
- How many characters should be received before the transmis-
sion is interrupted? This parameter also decides the size of the
buffer, i.e. how much of the RAM memory will be allocated.
Example (designed to make the example easy to run rather than
to illustrate a realistic application):
Background reception on the serial channel "uart1:".
Start character: A
End character: CHR$ (90) i.e. the character “Z”.
Characters to be ignored: #
Attention string: BREAK
Max. number of characters in buffer: 20
60 COMSET 1,"A",CHR$(90),"#","BREAK",20
CHR$ Function
Also see:
Chapter 9.2