Block check character – Rockwell Automation 5370 Color CVIM Communications Manual User Manual
Page 104

Chapter 5
Using the RS–232 Ports
5–36
After receiving the data, the host should respond with a DLE ACK to let the
Color CVIM module know that the message was received properly. If the
host returns a DLE NAK, the Color CVIM module will retransmit the data
up to three times before discarding the data packet.
Note: Some commands request a continuous flow of data from the Color
CVIM module. You can stop the flow of data by sending another command.
Note: A simple way to test the RS–232 links is to send the Color CVIM
module a DLE ENQ (enquiry). If you have the port properly connected and
the Color CVIM module is configured for RS–232, the Color CVIM module
should send a DLE ACK or DLE NAK in response. If no response is
provided, check your connections and Color CVIM module configuration.
The block check character (BCC) is a means of checking the accuracy of
each message packet transmission. It is the 2’s complement of the 8–bit sum
(modulo–256 arithmetic sum) of all data bytes between the DLE STX and
the DLE ETX BCC. It does not include any other message packet codes or
response codes.
For example, if a message packet contained the data codes 8, 9, 6, 0, 2, 4,
and 3, the message packet codes would be (in hex):
10
02
08
09 06 00 02 04 03 10
03
E0
DLE STX
Data
DLE ETX BCC
The sum of the data bytes in this message packet is 20 hex. The BCC is the
2’s complement of this sum, or E0 hex. This is shown in the following binary
calculation:
0010
000020 hex
1101
11111’s complement
+1
1110
00002’s complement (E0 hex)
ACK/NAK, BCC Characters
(cont’d)
Block Check Character