Intermec PB51 Fingerprint Developer's Guide (old) - Page 73

Setting Up RS-422 Communication, To set up the printer for RS-422 communication

Page 73 highlights

Chapter 4 - Managing Input and Output 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. The number of bytes includes characters that will be mapped as NUL. This example reads the number of bytes which remains to be received from the receiver buffer of "uart2:": 10 OPEN "uart2:" FOR INPUT AS #2 20 A%=LOC(2) 30 PRINT A% ... ... The example shows how the number of free bytes in the receive buffer of communication channel "uart2:" is calculated: 10 20 30 ... ... 80 90 100 1000 1010 1020 1030 1040 1050 1060 RUN OPEN "uart2:" FOR INPUT AS #2 A%=LOF(2) PRINT A% COMSET 1 ON IF QDATA$="" THEN GOTO 90 END QDATA$=COMBUF$(1) IF COMSTAT(1) AND 2 THEN PRINT A$ IF COMSTAT(1) AND 4 THEN PRINT B$ IF COMSTAT(1) AND 8 THEN PRINT C$ IF COMSTAT(1) AND 32 THEN PRINT D$ PRINT QDATA$ RETURN Setting Up RS-422 Communication Some Intermec printers can be fitted with an optional interface board that provides RS-422 connectivity (isolated or non-isolated) on "uart2:" or "uart3:". Neither of these 4-line protocols provide the hardware handshake (RTS/CTS) feature, but XON/XOFF or ENQ/ACK can be used if so desired. Two lines transmit data and the other two receive data. After you install the interface board in the printer, use the next procedure to set up RS-422 communication. To set up the printer for RS-422 communication 1 Set the printer flow control as follows: RTS/CTS: ENQ/ACK: Always Disable Enable or Disable Intermec Fingerprint Developer's Guide 57

  • 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
57
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.
The number of bytes includes characters that will be mapped as NUL.
This example reads the number of bytes which remains to be received from the
receiver buffer of “uart2:”:
10
OPEN “uart2:” FOR INPUT AS #2
20 A%=LOC(2)
30
PRINT A%
...
...
The example shows how the number of free bytes in the receive buffer of
communication channel “uart2:” is calculated:
10
OPEN “uart2:” FOR INPUT AS #2
20
A%=LOF(2)
30
PRINT A%
...
...
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
RUN
Setting Up RS-422 Communication
Some Intermec printers can be fitted with an optional interface board that provides
RS-422 connectivity (isolated or non-isolated) on “uart2:” or “uart3:”.
Neither of these 4-line protocols provide the hardware handshake (RTS/CTS)
feature, but XON/XOFF or ENQ/ACK can be used if so desired. Two lines transmit
data and the other two receive data.
After you install the interface board in the printer, use the next procedure to set up
RS-422 communication.
To set up the printer for RS-422 communication
1
Set the printer flow control as follows:
RTS/CTS:
Always Disable
ENQ/ACK:
Enable or Disable