Calculation Of Error Check Code (Crc-16) - Teledyne 7500 Instruction Manual

Infrared gas analyzer communication functions (modbus)
Hide thumbs Also See for 7500:
Table of Contents

Advertisement

5.5 Calculation of error check code (CRC-16)

CRC-16 is the 2-byte (16-bits) error check code. From the top of the message (station No.) to
the end of the data field are calculated.
The slave station calculates the CRC of the received message, and does not respond if the
calculated CRC is different from the contents of the received CRC code.
The following shows the calculation procedure for CRC-16.
(a) Store FFFFH into 16 bit register (CRC register).
(b) Subject the 1st byte (8 bits) of transmit message and CRC register contents to an
exclusive logical summation (XOR), and store the result into the CRC register.
(c) Shift the CRC register contents 1 bit to the right. Store 0 at MSB.
(d) If LSB before shifting is 0, do nothing.
If LSB before shifting is 1, subject it and A001H to XOR, and store the result into the CRC
register.
(e) Repeat the steps (c) and (d) 8 times (shift by 8 bits).
(f) Execute steps (b) to (e) for the next byte of the transmit message.
Likewise, successively repeat the steps to each byte of the transmit message.
(g) The CRC code that is retained is the value of CRC register that stands when the
processing has ended for latest byte (latest data except error code) of the transmit message.
(h) As error check code of the transmit message, store this CRC value in the order of lower 8
bits and upper 8 bits.
Transmit message (ex.)
01
06
H
00
H
05
H
03
H
E8
H
99
Successively calculate data included here to obtain CRC. In this case, CRC = 75
H
75
99H.
H
Attach the error check code to message upon interchanging the upper and lower orders.
Fig. 5-3 shows the flow of the CRC-16 calculation system.
Teledyne Analytical Instruments
12

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

7600

Table of Contents