- 21 -
8-3-5. Error check
Error check of transmission frame differs depending on the mode.
RTU mode: CRC-16
ASCII mode: LRC
①
Calculation of CRC-16
CRC system assigns the information that is to be sent, by generating polynomials, and sends the
rest of the information by appending it at the end. Generating polynomial is as follows.
1 + X
2
+ X
15
+ X
16
Target extends from slave address to the end of the data and calculation is done by the following
procedure.
1) Initialization (=FFFFH) of CRC-16 data (Consider it as X)
2) Exclusive-OR (EX-OR) of data 1 and X
→
X
3) Shift X one bit to the right
→
X
4) If carry appears get A001H and EX-OR. If it does not appear, go to 5).
→
X
5) Repeat 3) and 4) until shifting is done for 8 times.
6) Net data and EX-OR of X.
→
X
7) Same as 3) to 5).
8) Repeat until the end of the data.
9) Create messages in low order and high order of 16 bit data (X) that is calculated.
Example) When data is [02H] [07H], CRC-16 becomes 1241H hence the error check data becomes
[41H] [12H].