Chapter 1 Frame Specifications; Modbus Protocol Frame Specifications; Rtu Mode - Mitsubishi Electric MELSEC iQ-R Series Reference Manual

Modbus and modbus/tcp
Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

1
FRAME SPECIFICATIONS
1.1

MODBUS Protocol Frame Specifications

This section describes the frame specifications of the MODBUS protocol.
Address field
Area name
Address field
Protocol data unit
Error check
The following frame modes are available.

• RTU mode

• ASCII mode
The frame mode of C24 must be consistent with that of the target device.
RTU mode
In this mode, frames are received or sent in binary codes.
The frame specifications are compliant with the MODBUS protocol specifications.
Start
Address field
3.5 character time
or more
Error check in RTU mode
The error check in the RTU mode is conducted by CRC (Cyclic Redundancy Check).
C24 calculates the CRC by the following steps.
Follow the same steps to calculate the CRC when conducting an error check on the target device.
1.
Load the 16-bit register whose bits are all '1'.
2.
The CRC is calculated every 8 bits from the upper bit of the frame.
Calculate the exclusive OR (XOR) from the 8 bits of the frame and the bits of the step 1.
3.
Shift the result of step 2 by 1 bit to the right.
1 FRAME SPECIFICATIONS
6
1.1 MODBUS Protocol Frame Specifications
Function code
Protocol data unit
Description
■When request message is sent from the master to a slave
• 0: Sends a request message to all the slaves. (Broadcast)
• 1 to 247: Stores the target slave station number.
■When response message is sent from a slave to the master
The host station number is stored when sending a response message.
Function code
■When request message is sent from the master to a slave
Specifies the content of the processing instructed from the master to a slave.
■When response message is sent from a slave to the master
A requested function code is stored in the case of normal completion.
The most significant bit turns ON in the case of error completion.
Data
■When request message is sent from the master to a slave
Stores the request content of the processing.
■When response message is sent from a slave to the master
Stores the execution result of the processing.
The master adds a check code in a request message and transmits the request message.
The slave, which received the request message, recalculates the check code in the request message
and determines whether the message is correct or not.
The message is discarded if it has an error.
The error check method differs depending on the frame mode.
Function code
1 byte
1 byte
Error check calculation range
Data
Error check
Data
Error check
2 bytes
0 to 252 bytes
END
Address field
(Start)
3.5 character time
1 byte
or more

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents