e
Electro Industries/Gauge Tech
Doc # E134-7-15 V1.01
3-4
3.5: CRC (Error Checksum) Algorithm
3.5: CRC (Error Checksum) Algorithm
n
The Cyclic Redundancy Check (CRC) field is an error checksum calculation that enables a Slave
device to determine if a request packet has been corrupted during transmission.
n
Every request packet transmitted from Master to Slave includes a special 16-bit value derived from a
CRC-16 algorithm performed on the packet’s contents. When a Slave receives a packet, it performs a
CRC-16 calculation and compares the value with the one included in the request packet. If the two
values do not match, the Slave will ignore the packet.
n
The following is the pseudocode for calculating the 16-bit CRC:
Initialize a 16-bit register to FFFFH.
Initialize the generator polynomial to A001H.
Slave Address
01H
Slave Address
01H
Function Code
10H
Function Code
10H
Data Starting Address-Hi
E0H
Data Starting Address-Hi
E0H
Data Starting Address-Lo
01H
Data Starting Address-Lo
01H
Number of Setpoints-Hi
00H
Number of Setpoints-Hi
00H
Number of Setpoints-Lo
03H
Number of Setpoints-Lo
03H
Byte Count
06H
CRC-Lo
E6H
Data #1-Hi
00H
CRC-Hi
08H
Data #1-Lo
01H
Data #2-Lo
00H
Data #2-Hi
01H
Data #3-Lo
00H
Data #3-Hi
01H
CRC-Lo
4DH
CRC-Hi
46H
Master Packet
Slave Packet
Table 3.4: Function Code 10 Example
1
16
224
1
0
3
6
0
1
0
1
0
1
77
70
Dec
Hex
Hex
Dec
1
16
224
1
0
3
230
8
Summary of Contents for I/O Module
Page 2: ......
Page 6: ...e Electro Industries Gauge Tech Doc E134 7 15 V1 01 iv ...
Page 10: ...e Electro Industries Gauge Tech Doc E134 7 15 V1 01 viii ...
Page 30: ...e Electro Industries GaugeTech Doc E134 7 15 V1 01 2 16 ...
Page 44: ...e Electro Industries GaugeTech Doc E134 7 15 V1 01 4 8 ...
Page 50: ...e Electro Industries GaugeTech Doc E134 7 15 V1 01 6 4 ...
Page 52: ...e Electro Industries Gauge Tech Doc E 134 7 15 V1 01 7 2 ...
Page 63: ...e Electro Industries GaugeTech Doc E134 7 15 V1 01 8 4 ...
Page 65: ...e Electro Industries Gauge Tech Doc E 134 7 15 V1 01 9 2 ...
Page 72: ...e Electro Industries GaugeTech Doc E134 7 15 V1 01 10 4 ...
Page 74: ...e Electro Industries Gauge Tech Doc E 134 7 15 V1 01 11 2 ...
Page 81: ...e Electro Industries Gauge Tech Doc E 134 7 15 V1 01 13 2 ...
Page 87: ...e Electro Industries GaugeTech Doc E134 7 15 V1 01 14 4 ...
Page 89: ...e Electro Industries Gauge Tech Doc E 134 7 15 V1 01 15 2 ...