beautypg.com

B.7 block checksum generation and checking, Using the bdlc protocol – Siemens SIMATIC TIWAY 1 User Manual

Page 201

background image

USING THE BDLC PROTOCOL

UNILINK HOST ADAPTER

B–16

USER MANUAL

B.7

BLOCK CHECKSUM GENERATION AND CHECKING

To calculate the BCS:

1.

Zero both BCS field bytes.

2.

Begin with the address field byte.

3.

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

4.

Add the most significant BCS byte to the least significant BCS byte,
again including the carry.

5.

Get the next frame byte and go to Step 3. If there are no more bytes,
continue with the following steps.

6.

Add the least significant byte to the most significant byte.

7.

Calculate the ones-complement of the most significant BCS byte.

Example B–3 illustrates how to calculate the BCS on an example frame. The
BCS like the Cyclic Redundancy Checksum (CRC) detects burst errors,
single-bit errors, and most double-bit errors.