Rockwell Automation 1770, D17706.5.16 Ref Mnl DF1 Protocol Command User Manual
Page 77

5–5
Data-link Layer Message Frames
Publication 1770Ć6.5.16 - October 1996
Full-duplex protocol example
If a message frame contained the data 08. 09, 06, 00, 02,04, and 03 (decimal),
the message symbols are:
10
02
08 09 06 00 02 04 03
10
03
E0
DLE
STX APP DATA
DLE ETX BCC
The sum of the application data bytes in this message frame is 32 decimal or 20 hex.
The BCC is the 2's complement of this sum, or E0 hex. This is shown in the following
binary calculation:
0010 0000 20
16
1101 1111 1's complimen
t
+1
ĆĆĆĆĆĆĆĆĆĆĆĆĆĆĆ
1110 0000
2's compliment (E0 hex)
To quickly determine a BCC value, add up the hex values of the application layer bytes.
If the total is greater than 100 hex, drop the most significant digit. Then, subtract the result
from 100 hex. This gives you the BCC. For example, if the sum of the application layer
bytes is 20 hex, then:
100
16
-20
16
____
E0
16
Important:
To transmit the value 10 hex, you must use the data symbol DLE DLE.
However, only one of these DLE data bytes is included in the BCC sum.
For example, to transmit the values 08, 09, 06, 00, 10, 04, and 03 hex, use
the following message symbols:
10
02
08 09 06 00 10 10 04 03
10
03
D2
DLE
STX
APP DATA (DLE DLE)
DLE EXT BCC
In this case, the sum of the application layer data bytes is 2E hex because only one DLE
byte is included in the BCC. So the BCC is D2
16
. This is sometimes referred to as
doubleĆstuffing" DLEs.
Important: If your BBC check sum is 10 hex, send it as “10” and
not “10 10.” That is, a BCC is not treated like data.