Bcc and crc fields – Rockwell Automation 1770, D17706.5.16 Ref Mnl DF1 Protocol Command User Manual

Page 76

Advertising
background image

5–4

Data-link Layer Message Frames

Publication 1770Ć6.5.16 - October 1996

At the end of each polling frame and each message frame, there is
a one-byte BCC (block check character) field, or a two byte CRC
(cyclic redundancy check) field. You select BCC or CRC through
switch settings or software configuration. Either field allows you to
verify the accuracy of each message frame transmission:

The BCC algorithm provides a medium level of data security:

it cannot detect transposition of bytes during transmission
of a frame

it cannot detect the

insertion or deletion of the value zero

within a frame

The CRC field provides a higher level of data security than BCC
but is more difficult to implement

BCC Field

We’ve included both half- and full-duplex BCC examples:

Half-duplex protocol example

If the master node wants to send the hexadecimal data symbols 08, 09, 06, 00, 10, 04, and

03 to slave node 20

16

(40 octal), the master message symbols are:

10 01 20 10 02 08 09 06 00 10 10 04 03 10 03 B2

STN DLE STX APP DATA (DLE DLE) DLE ETX BCC
The sum of the STN and application layer data bytes in this message frame is 4E

16

.

The BCC is the 2's complement of this sum, or B2

16

. This is shown in the following binary

calculation:
0100 1110 = sum (4E

16

)

1011 0001 = 1's complement

+1

ĆĆĆĆĆĆĆĆĆĆĆĆĆĆĆĆĆĆ

1011 0010 2's complement (B2

16

= BCC)

To transmit the STN or data value 10 hex, you must use the data symbol DLE DLE.

You must also use the data symbol DLE DLE if your STN value is 10. Only one of these

DLE bytes, however, is included in the BCC sum.
For example, to transmit the data values 08, 09, 06, 00, 10, 04, and 03 (hex), a slave node

uses 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 data bytes is 2E hex because only one DLE byte is included in

the BCC. The BCC (2's complement) of 2E

16

is D2

16

.

BCC and CRC Fields

Advertising