Chapter 11 RS485 Communication
11-1-6
■ (3) Data
Send data related to the function code.
The data transmission format varies depending on the function code.
Among the data used in Modbus communication, the following data formats are supported.
Readable/writable binary data (1-bit length)
Readable/writable 16-bit length data
Modbus communication of WJ-C1 has restrictions on writing to "2 register length parameter".
For details, refer to "Exception code 27h" in "11.2.9 Exceptional Responses".
■ (4) Error checking
CRCs (Cyclic Redundancy Check) are used for error checking of Modbus-RTU.
The generation polynomial of CRC-16(X
16
+X
15
+X
2
+ 1) is used to generate the CRC code.
The CRC code is 16-bit data generated for a block of arbitrary data length in 8-bit units.
Swapping high bytes and
low bytes in CRC
*1
CRC
*1
= CRC
*1
XOR target data
CRC
*1
= Shift CRC
*1
by 1 bit to the right
There is a
remaining bit.
Shifting by 1byte to the target data