4
- 11
4.2 Frame Specifications
4.2.1 Frame mode
4
MODBUS(R) STANDARD FUNCTIONS
4.2.1 Frame mode
For the QJ71MB91, the following frame modes are available.
The frame mode of the QJ71MB91 must be consistent with that of the target device.
(1) Available frame modes
(a) RTU mode
In this mode, frames are received or sent in binary codes.
The frame specifications are compliant with the MODBUS protocol
specifications.
Remark
The error check in the RTU mode is conducted by CRC (Cyclic Redundancy
Check).
The QJ71MB91 calculates the CRC by the following steps.
Please follow the same steps to calculate the CRC when conducting an error
check on the target device.
1) Load the register whose 16 bits are all "1".
2) The CRC is calculated every 8 bits from the upper bit of the frame.
Calculate the 8 bits of the frame and the exclusive logical sum (XOR) of the
bits in the above 1).
3) Shift the result of 2) by 1 bit to the right.
4) If the least significant bit of the above 2) is "1", calculate the exclusive OR
(XOR) from the result in 3) and the generator polynomial (A001
H
).
If the least significant bit is "0", do not calculate the exclusive OR (XOR), but
shift it by 1 bit to the right.
5) Repeat the above steps 3) and 4) until the bit is shifted up to 8 times.
6) Calculate the exclusive OR (XOR) from the result of 5) and the next 8 bits of
the frame.
7) Repeat steps 3) to 6).
8) Repeat the above operations until the end of the data unit is reached.
The final value is a calculated CRC value.
9) The CRC value is stored in the frame in the order from the lower 8 bits to the
upper 8 bits.
Figure 4.2 Frame in RTU mode
Data
Start
Address field
Function code
Error check
END
(Start)
Address field
3.5 character time
or more
1 byte
1 byte
0 to 252 bytes
2 bytes
3.5 character time
or more
1 byte
Error check calculation range
Содержание QJ71MB91
Страница 1: ......
Страница 2: ......
Страница 366: ...App 14 Appendix 4 External Dimensions APPENDICES Memo ...
Страница 371: ......
Страница 372: ......