9
Modbus RTU On-Board Communications
POWERXL SERIES VFD MN040010EN—June 2018 www.eaton.com
Modbus communication standards
The Modbus protocol is an industrial communications and
distributed control system to integrate PLCs, computers,
terminals, and other monitoring, sensing and control devices.
Modbus is a Master-Slave communications protocol. The
Master controls all serial activity by selectively polling one
or more slave devices. The protocol provides for one master
device and up to 247 slave devices on a common line. Each
device is assigned an address to distinguish it from all other
connected devices.
The Modbus protocol uses the master-slave technique, in
which only one device (the master) can initiate a transaction.
The other devices (the slaves) respond by supplying the
requested data to the master, or by taking the action
requested in the query. The master can address individual
slaves or initiate a broadcast message to all slaves. Slaves
return a message (“response”) to queries that are addressed
to them individually. Responses are not returned to
broadcast queries from the master.
A transaction comprises a single query and single response
frame or a single broadcast frame. The transaction frames
are defined below.
Figure 12. The basic structure of a modbus frame
Master’s
Message
Slave’s
Response
Start
End
Address
Function
Data
CRC
Start
End
Address
Function
Data
CRC
Valid slave device addresses are in the range of 0–247
decimal. The individual slave devices are assigned addresses
in the range of 1–247. A master addresses a slave by placing
the slave address in the address field of the message. When
the slave sends its response, it places its own address in
this address field of the response to let the master know
which slave is responding.
The function code field of a message frame contains two
characters (ASCII) or eight bits (RTU). Valid codes are in the
range of 1–255 decimal. When a message is sent from a
master to a slave device, the function code field tells the
slave what kind of action to perform.
Examples are to read the ON/OFF states of a group of
discrete coils or inputs; to read the data contents of a group
of registers; to read the diagnostic status of the slave; to
write to designated coils or registers; or to allow loading,
recording or verifying the program within the slave.
When the slave responds to the master, it uses the function
code field to indicate either a normal (error-free) response
or that some kind of error occurred (called an exception
response). For a normal response, the slave simply echoes
the original function code. For an exception response, the
slave returns a code that is equivalent to the original function
code with its most significant bit set to a logic state of 1.
The data field is constructed using sets of two hexadecimal
digits, in the range of 00 to FF hexadecimal. These
can be made from a pair of ASCII characters, or from
one RTU character, according to the network’s serial
transmissionmode.
The data field of messages sent from a master to slave
devices contains additional information that the slave must
use to take the action defined by the function code. This
can include items like discrete and register addresses, the
quantity of items to be handled, and the count of actual data
bytes in the field.
If no error occurs, the data field of a response from a
slave to a master contains the data requested. If an error
occurs, the field contains an exception code that the master
application can use to determine the next action tobetaken.
Two kinds of checksum are used for standard Modbus
networks. The error checking field contents depend upon the
transmission method that is being used.