Explanation of ascii programming example (cont’d) – Rockwell Automation 5370 CVIM Communications Manual User Manual
Page 94

Chapter 5
Using the RS–232 Ports
5–24
Assume the ASCII string from the CVIM module is:
CR LF 2114 __ __ __ __ __ __389 __ __ __ __ __ B0__80__
A2__ 00__00__(etc.)CR LF
Note: ( __ = space, LF = Line Feed, CR = Carriage Return)
The 18 element hexadecimal array after the program receives the data:
R1(0) = 2114 = Decimal representation of total triggers processed.
R1(1) = 389 = Decimal representation of total master faults (failed
inspections).
R1(2) = B0 = Hexadecimal representation of discrete input word 0 low
byte.
R1(3) = 80 = Hexadecimal representation of discrete input word 0 high
byte.
R1(4) = A2 = Hexadecimal representation of discrete input word 1 low
byte (Window 1 Fault/Warning, Window 2 Fault/Warning, etc.).
• • •
R1(17) = 00 = Hexadecimal representation of discrete input word 7 high
byte (Gage 32 Fault/Warning, Gage 31 Fault/Warning, etc.).
The decimal display on the monitor will appear as follows after the program
manipulates the array:
2114
389
176
135
162
0
0
0
0
0
0
0
0
0
0
0
0
0
Analysis of R1(4) for window failure:
R1(4) = 162 (decimal). The binary representation is:
1 0 1 0 0 0 1 0
The three ones in this representation indicate fail discrete input conditions in
windows 1, 3, and 4 (bits 1, 5, and 7 of word 1, see Table 4.A.).
Explanation of ASCII
Programming Example
(cont’d)