MODBUS RTU PROTOCOL
Each data byte is transmitted in an asynchronous format consisting of 1 start bit, 8 data bits, 1 stop bit, and possibly 1
parity bit. This produces a 10 or 11 bit data frame. This can be important for transmission through modems at high bit
rates (11 bit data frames are not supported by many modems at baud rates greater than 300).
The RS232 port is intended for local use, with baud rate set at 115200 or 19200 bps under Settings > Product Setup >
Communications > Serial Ports. The rear terminal RS485 port can be set for baud rates of 300, 1200, 2400, 4800, 9600,
14400, 19200, 28800, 33600, 38400, 57600, or 115200 bps, and even, odd, and no parity options are available. The USB
port is intended for local use and is included with the graphical front panel. See the Communications section of chapter 5
in the Instruction Manual for details.
2
The Modbus TCP/IP protocol is available on each of the rear Ethernet ports. These ports are 100Base-FX.
2.1.4 Data link layer
Modbus RTU communications takes place in packets that are groups of asynchronously framed byte data. The master
transmits a packet to the slave and the slave responds with a packet. The following information describes the general
format for both transmit and receive packets. For details on packet formatting, see subsequent sections describing each
function code.
Table 2-1: Modbus RTU packet format
Description
SLAVE ADDRESS
FUNCTION CODE
DATA
CRC
DEAD TIME
— This is the address of the slave device that is intended to receive the packet sent by the master and to
SLAVE ADDRESS
perform the desired action. Each slave device on a communications bus must have a unique address to prevent bus
contention. All of the relay's ports have the same address which is programmable from 1 to 254; see chapter 5 in the
Instruction Manual for details. Only the addressed slave will respond to a packet that starts with its address. Note that the
front panel port is an exception to this rule; it acts on a message containing any slave address.
A master transmit packet with slave address 0 indicates a broadcast command. All slaves on the communication link take
action based on the packet, but none respond to the master.
— This is one of the supported functions codes of the unit which tells the slave what action to perform. See
FUNCTION CODE
the
Supported function codes section on page 2-4
the high order bit of the function code in the response packet. See the
— This is a variable number of bytes depending on the function code. It can include actual values, settings, or
DATA
addresses sent by the master to the slave or by the slave to the master.
— This is a two byte error checking code. The RTU version of Modbus includes a 16-bit cyclic redundancy check (CRC-
CRC
16) with every packet which is an industry standard method used for error detection. If a Modbus slave device receives a
packet in which an error is indicated by the CRC, the slave device does not act upon or respond to the packet thus
preventing any erroneous operations. See the
the CRC.
— A packet is terminated when no data is received for a period of 3.5 byte transmission times (about 15 ms at
DEAD TIME
2400 bps, 2 ms at 19200 bps, and 300 µs at 115200 bps). Consequently, the transmitting device must not allow gaps
between bytes longer than this interval. Once the dead time has expired without a new byte transmission, all slaves start
listening for a new packet from the master except for the addressed slave.
Modbus-TCP/IP communications takes place in application data units (ADUs), which are wrapped in the TCP/IP/Ethernet
protocols. Ethernet provides layer 2 addressing and CRC-32 error checking. IP provides layer 3 addressing. TCP provides
communication establishment and ending and manages data flow. The Parallel Redundancy Protocol (PRP) can also be
used to provide seamless data flow in case of a single failure in the network, by using a combination of LAN duplication
and frame duplication. See chapter 5 in the instruction manual for information on setting up TCP for Modbus (in the
Modbus section), IP and PRP (Network section).
2-2
Size
1 byte
1 byte
N bytes
2 bytes
3.5 bytes transmission time
for details. An exception response from the slave is indicated by setting
Modbus RTU CRC-16 algorithm section on page 2-3
CHAPTER 2: MODBUS COMMUNICATION
Exception responses section on page 2-6
for details on calculating
UR FAMILY – COMMUNICATIONS GUIDE
for details.