3 Modbus protocol description
22
3.8 Checksum (CRC16)
Transmission errors are detected with the aid of the checksum (CRC16). If an error is detected during
evaluation, the device concerned does not respond.
Calculation principle
NOTE!
The low byte of the checksum is transmitted first!
Example: The CRC16 checksum 0x1234 is transmitted and represented in the sequence 0x3412.
Example
Write binary value 1 to the external digital input 1 (word address 0x37A1):
CRC = 0xFFFF
CRC = CRC XOR BytesOfMessage
For (1 to 8)
CRC = SHR(CRC)
if (flag shifted to the right = 1
then else
CRC = CRC XOR 0xA0001
while (not all BytesOfMessage processed);
Instruction (CRC16 = 9C17):
01 06 37 A1 00 01 17 9C
Slave Function Word address Value CRC
Response:
01 06 37 A1 00 01 17 9C
Slave Function Word address Value CRC