Crc field – Rockwell Automation 1770, D17706.5.16 Ref Mnl DF1 Protocol Command User Manual

Page 78

Advertising
background image

5–6

Data-link Layer Message Frames

Publication 1770Ć6.5.16 - October 1996

CRC Field

For these protocols

You calculate the CRC value

fullĆduplex

using the value of the linkĆlayer data bytes and the ETX byte.

halfĆduplex

for master messages using the value of the linkĆlayer data

bytes and the STN, STX and ETX bytes

for slave messages using the value of the linkĆlayer data bytes

and the ETX byte

The polynomial for a CRC value is:

X

16

+ X

15

+ X

2

+ X

0

.

Do not add in the associated DLE for STX and ETX values.

Important: To transmit the data value of 10

16

, you must use the

data symbol DLE DLE. However, only one of these
DLE bytes is included in the CRC value.
Embedded responses are not included in the CRC value.

The following explains the transmission of the CRC value:

1.

At the start of a message frame, the transmitter clears a 16-bit
register used for the CRC value.

2.

As a byte is transmitted, it is exclusive-ORed (least-significant bit
to the right) with the right eight bits of the CRC register.

3.

The result is placed in the right eight bits of the CRC register.

4.

The CRC register is then shifted right eight times by inserting 0s
on the left. Each time a 1 is shifted out on the right, the CRC
register is exclusive-ORed with this 16-bit constant:

1010 0000 0000 0001

5.

As each additional byte is transmitted, it is included in the value
in the register the same way.

6.

After the ETX value is transmitted, the value in the CRC register
is transmitted (right bit first). The receiver also calculates the
CRC value and compares it to the received CRC value to verify
the accuracy of the data received.

Advertising