C |
Cyclic Redundancy Check (CRC)
The Cyclic Redundancy Check (CRC) consists of 2 check characters generated at the transmitter and added at the end of the transmitted data characters. The receiver gener- ates its own CRC for the incoming data and compares it to the CRC sent by the transmit- ter to ensure proper transmission.
The transmitter calculates the CRC. The essential steps are:
1.Multiply the data bits that make up the message by the number of bits in the CRC.
2.Divide the result by the generating polynomial (using modulo 2 with no carries). The CRC is the remainder of this division.
3.Discard the quotient.
4.Add the remainder (CRC) to the data bits.
5.Transmit the message with CRC.
The receiver divides the message plus CRC by the generating polynomial. If the remainder is 0, the transmission was transmitted without error.
The Generating Polynomial
A generating polynomial is expressed as a string of terms in powers of X such as X3 + X2
+X0 (or 1). It can also be expressed as a binary number. RTU protocol uses the polyno- mial X16 + X15 + X2 + 1 which in binary is 1 1000 0000 0000 0101. The CRC this polyno- mial generates is known as CRC±16.
It can be implemented in hardware or software.
GFK±0804B | Appendix C RTU Protocol |