27
4 Modbus protocol description
4.8 Checksum (CRC16)
Calculation
scheme
The checksum (CRC16) serves to recognize transmission errors. If an error is
identified during evaluation, the device concerned does not respond.
Example 1 Requesting the status of relay output 1.
Instruction: Read a word from the address 0x1631
Response (CRC = 0x8479):
Word 1 = 1 indicates that relay 1 is active.
CRC = 0xFFFF
CRC = CRC XOR ByteOfMessage
For (1 to 8)
CRC = SHR(CRC)
if (flag shifted right = 1)
then else
CRC = CRC XOR 0xA001
while (not all ByteOfMessage processed);
The low byte of the check sum is the first to be transmitted!
01 03 1631 0001 D18D
01 03 02 0001 7984
Word 1