Intermec PD42 Fingerprint Developer's Guide (old) - Page 71

Managing Input and Output, Intermec Fingerprint Developer's Guide

Page 71 highlights

Chapter 4 - Managing Input and Output • the character or string of characters used to tell the printer to start receiving data and to stop receiving data. • the character or characters to be ignored (filtered out from the received data). • the character or string of characters to use as an attention string that interrupts reception. Note: Start, stop, ignore, and attention characters are selected according to the protocol of the computing device that transmits the data. Non-printable characters, for example STX and ETX can be specified using a CHR$ function. To specify no character, use an empty string. • the number of characters received before the transmission is interrupted. This parameter also decides the size of the buffer (that is, how much of the temporary memory will be allocated). In this example, the background reception is set to channel "uart1:", the Start character is A, the End character is CHR$ (90) (the character Z), the character to be ignored is #, the attention string is BREAK, and the maximum number of characters in the buffer is 20: 60 COMSET 1,"A",CHR$(90),"#","BREAK",20 3 Use an ON COMSET GOSUB statement to specify a subroutine to branch to when reception is interrupted. Interruption occurs when any of the following conditions are fulfilled: • an end character is received. • an attention string is received. • the maximum number of characters have been received. In this example, when the reception of data on communication channel 1 ("uart1:") is interrupted, the execution branches to a subroutine starting on line number 1000. 70 ON COMSET 1 GOSUB 1000 4 Turn on the COMSET: 80 COMSET 1 ON Note: The COMSET interrupt has to be turned on after it has occurred and been taken care of. 5 When reception is interrupted, check the buffer contents. You can read the content of the buffer (for example, to a string variable) using a COMBUF$ function: 1000 QDATA$=COMBUF$(1) The COMSTAT function can be used to detect what has caused the interruption. Use the logical operator AND to detect the following four reasons of interruption as specified by COMSET: • Max. number of characters received (2). • End character received (4). Intermec Fingerprint Developer's Guide 55

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187

Chapter 4 — Managing Input and Output
Intermec Fingerprint Developer’s Guide
55
the character or string of characters used to tell the printer to start receiving
data and to stop receiving data.
the character or characters to be ignored (filtered out from the received data).
the character or string of characters to use as an attention string that
interrupts reception.
the number of characters received before the transmission is interrupted.
This parameter also decides the size of the buffer (that is, how much of the
temporary memory will be allocated).
In this example, the background reception is set to channel “uart1:”, the Start
character is A, the End character is CHR$ (90) (the character Z), the character to
be ignored is #, the attention string is BREAK, and the maximum number of
characters in the buffer is 20:
60 COMSET 1,“A”,CHR$(90),“#”,“BREAK”,20
3
Use an ON COMSET GOSUB statement to specify a subroutine to branch to
when reception is interrupted. Interruption occurs when any of the following
conditions are fulfilled:
an end character is received.
an attention string is received.
the maximum number of characters have been received.
In this example, when the reception of data on communication channel 1
(“uart1:”) is interrupted, the execution branches to a subroutine starting on line
number 1000.
70 ON COMSET 1 GOSUB 1000
4
Turn on the COMSET:
80 COMSET 1 ON
5
When reception is interrupted, check the buffer contents. You can read the
content of the buffer (for example, to a string variable) using a COMBUF$
function:
1000 QDATA$=COMBUF$(1)
The COMSTAT function can be used to detect what has caused the interruption.
Use the logical operator AND to detect the following four reasons of
interruption as specified by COMSET:
Max. number of characters received (2).
End character received (4).
Note:
Start, stop, ignore, and attention characters are selected according to
the protocol of the computing device that transmits the data. Non-printable
characters, for example STX and ETX can be specified using a CHR$
function. To specify no character, use an empty string.
Note:
The COMSET interrupt has to be turned on after it has occurred and been
taken care of.