GE GFK-0804B 用户手册

下载
页码 160
C
C-5
GFK–0804B
Appendix C RTU Protocol
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 X
3
 + X
2
+ X
0
 (or 1). It can also be expressed as a binary number.  RTU protocol uses the polyno-
mial X
16
 + X
15
 + X
2
 + 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.