Rockwell Automation 1770-KF2 Data Highway or Highway Plus Interface Module User Manual User Manual

Page 48

Advertising
background image

Asynchronous Link Protocols

Chapter 4

4-5

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 0000

20 hex

1101 1111

1’s complement

+1
1110 0000

2’s complement (E0 hex)

Example 2: To transmit the data value 10 hex, you must use the data
code 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, you would use the following message codes:

10

DLE

STX

02

08 09 06 00 10 10 04 03

10

03

D2

DLE

ETX

BCC

Data

Represents Single Data Byte Value of 10

In this case, the sum of the data bytes is 2E hex because only one DLE
text code is included in the BCC. So the BCC is D2 hex.

The BCC algorithm provides a medium level of data security. It cannot
detect transposition of bytes during transmission of a packet. It also
cannot detect the insertion or deletion of data values of zero within a
packet.

Cyclic Redundancy Check

Calculate the CRC value on the value of the data bytes and the ETX byte
(using the polynomial x

16

+ x

15

+ x

2

+ x

0

). To transmit the data value of

10 hex, you must use the data code DLE DLE. However, only one of
these DLE data bytes is included in the CRC value. Embedded responses
are not included in the CRC value.

At the start of a message packet, the transmitter clears a 16-bit register for
the CRC value. As a byte is transmitted, it is exclusive-ORed (with Bit 0
to the right) to the right eight bits of the register. The register is then
shifted right eight times with zeros (0s) inserted on the left. Each time a
one (1) is shifted out on the right the following binary number is
exclusive-ORed with the 16-bit register value:

Advertising