User`s manual
44
FX3U Series Programmable Controllers
User’s Manual - MODBUS Serial Communication Edition
7 MODBUS Standard Commands
7.2 Frame Specifications
7.2.1 Frame mode
For the FX-Series MODBUS Communication ADP, the following frame modes are available.
The frame mode of the FX-Series MODBUS Communication ADP 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.
Note
The Cyclical Redundancy Checking (CRC) field is two bytes, containing a 16-bit binary value. The CRC value
is calculated by the transmitting device, which appends the CRC to the message. The device that receives
recalculates a CRC during receipt of the message, and compares the calculated value to the actual value it
received in the CRC field. If the two values are not equal, an error results.
A procedure for generating a CRC is:
1) Load a 16-bit register with FFFF hex (all 1’s). Call this the CRC register.
2) Exclusive OR the first 8-bit byte of the message with the low-order byte of the 16-bit CRC register, putting
the result in the CRC register.
3) Shift the CRC register one bit to the right (toward the LSB), zero-filling the MSB (Most Significant bit).
Extract and examine the LSB (Least Significant bit).
4) (If the LSB was 0): Repeat Step 3 (another shift).
(If the LSB was 1): Exclusive OR the CRC register with the polynomial value 0xA001 (1010 0000 0000
0001).
5) Repeat Steps 3 and 4 until 8 shifts have been performed. When this is done, a complete 8-bit byte will
have been processed.
6) Repeat Steps 2 through 5 for the next 8-bit byte of the message. Continue doing this until all bytes have
been processed.
7) The final content of the CRC register is the CRC value.
8) When the CRC is placed into the message, its upper and lower bytes must be switched as described
below.
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 1 byte
Error check calculation range
3.5 character
time or more