App. - 52 App. - 52
APPENDIXES
(4) Procedure for calculating 16-bit CRC (for MODBUS)
This is a check system that is used only when data are sent/received in the RTU
mode of the MODBUS protocol. The data length of CRC is fixed to 2 bytes (16
bits), and the CRC is calculated every 1 byte (8 bits) from the start of the
calculating range according to the following procedure.
1) Load a 16-bit register whose bits are all '1'.
2) Exclusive OR (XOR) the first 1 byte (8 bits) of the calculating range
with 8 bits in above 1).
3) Shift the result of 2) one bit right.
4) If the latest significant bit in above 2) is '1', exclusive OR (XOR) the
result of 3) with the generator polynomial (A001
H
). If the last bit is '0',
shift the result of 2) one bit right (operation described in 3)) without the
exclusive OR (XOR) operation.
5) Repeat steps 3) and 4) until 8 shifts have been performed.
6) Exclusive OR (XOR) the result of 5) with the next 1 byte (8 bits).
7) Repeat step 2) through 6) until all bytes have been processed.
The final result is CRC value.
8) When the CRC value is placed in a packet, the lower 8 bits are set first,
and then the upper 8 bits are set.
For the specific example of calculation, refer to the table on the next page.
Содержание MELSEC LJ71C24
Страница 1: ......
Страница 2: ......
Страница 18: ...A 16 A 16 INDEX REVISIONS WARRANTY...
Страница 22: ...A 20 A 20 2 LJ71C24 R2 LJ71C24 R2 Before Using the Product...
Страница 23: ...A 21 A 21 MEMO...
Страница 38: ...4 2 4 2 4 PROCEDURES PRIOR TO OPERATION MEMO 4...
Страница 105: ...7 30 7 30 7 SETTINGS FOR THE C24 MEMO...
Страница 391: ...App 62 App 62 APPENDIXES 3 Refresh parameter setting In Refresh Parameter set the following network parameters...
Страница 425: ......
Страница 426: ......
Страница 427: ......