5-40
5.3.3 Error checking
5.3.3.1 CRC-16
When sending data, CRC data is used to check for errors in the transmission frame.
CRC is the most effective system for error checking. At the sending side, the CRC value is
calculated and added to the last level of the frame. Then, at the receiving side, the CRC value is
calculated again in the same way based on the received data. The two CRC values are then
cross-checked.
Simplified steps for calculating CRC
z Convert the data to a polynomial (Ex. 1100 0000 0010 0001 → X15 + X14 + X5 + 1) and
then divide this polynomial by a generating polynomial (17 bit; X16 + X15 + X2 + 1). The
remainder (16 bit) is the CRC value.
z Add the "remainder" to the last level of the data, disregarding the quotient, and send the
message.
z The recipient divides the received message (with the CRC value added) by the generating
polynomial. If the "remainder" is zero, the message has been received without errors.
CRC-16
A generating polynomial is expressed as factors of X such as "X
3
+ X
2
+ X", rather than binary codes
such as "1110".
Although any kind of generating polynomial can be used, some standard types are defined and
proposed for optimal error detection.
For RTU, the "X
16
+ X
15
+ X
2
+ 1" generating polynomial, which corresponds to "1 1000 0000 0000
0101" in binary code, is used. The CRC that is generated with this polynomial is known as
"CRC-16".