beautypg.com

Using the bdlc protocol – Siemens SIMATIC TIWAY 1 User Manual

Page 203

background image

USING THE BDLC PROTOCOL

UNILINK HOST ADAPTER

B–18

USER MANUAL

The receiver checks the BCS by adding all the received frame bytes excluding
the starting and ending flags, and any inserted DLEs. The procedure is:

1.

Zero the two calculation registers.

2.

Begin with the address field byte.

3.

Add the byte to the most significant register including any carry bit
generated. (Use only eight bit arithmetic in these steps).

4.

Add the most significant register to the least significant register, again
including the carry.

5.

Get the next frame byte and go to Step 3. When there are no more bytes,
both calculation registers should be ZERO or a NEGATIVE ZERO
represented by FF hex. If not, then an error has occurred.

Example B–4 illustrates the receiver check of the BCS in Example B–3. Notice
that both registers contain negative zero values at the end of the calculation,
indicating a successful frame transmission. (Note: All values are in
hexadecimal notation.)

Example B–4 Block Checksum Receiver Calculation

Frame
Byte

MSB

LSB

01

00
01

00
01

93

94

95

D5

6A

FF

95

FF

FF