2-2 UR FAMILY – COMMUNICATIONS GUIDEMODBUS RTU PROTOCOL CHAPTER 2: MODBUS COMMUNICATION2Each data byte is transmitted in an asynchronous format consisting of 1 start bit, 8 data bits, 1 stop bit, and possibly 1parity bit. This produces a 10 or 11 bit data frame. This can be important for transmission through modems at high bitrates (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 USBport is intended for local use and is included with the graphical front panel. See the Communications section of chapter 5in the Instruction Manual for details.The Modbus TCP/IP protocol is available on each of the rear Ethernet ports. These ports are 100Base-FX.2.1.4 Data link layerModbus RTU communications takes place in packets that are groups of asynchronously framed byte data. The mastertransmits a packet to the slave and the slave responds with a packet. The following information describes the generalformat for both transmit and receive packets. For details on packet formatting, see subsequent sections describing eachfunction code.Table 2-1: Modbus RTU packet formatSLAVE ADDRESS — This is the address of the slave device that is intended to receive the packet sent by the master and toperform the desired action. Each slave device on a communications bus must have a unique address to prevent buscontention. All of the relay’s ports have the same address which is programmable from 1 to 254; see chapter 5 in theInstruction Manual for details. Only the addressed slave will respond to a packet that starts with its address. Note that thefront 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 takeaction based on the packet, but none respond to the master.FUNCTION CODE — This is one of the supported functions codes of the unit which tells the slave what action to perform. Seethe Supported function codes section on page 2-4 for details. An exception response from the slave is indicated by settingthe high order bit of the function code in the response packet. See the Exception responses section on page 2-6 for details.DATA — This is a variable number of bytes depending on the function code. It can include actual values, settings, oraddresses sent by the master to the slave or by the slave to the master.CRC — This is a two byte error checking code. The RTU version of Modbus includes a 16-bit cyclic redundancy check (CRC-16) with every packet which is an industry standard method used for error detection. If a Modbus slave device receives apacket in which an error is indicated by the CRC, the slave device does not act upon or respond to the packet thuspreventing any erroneous operations. See the Modbus RTU CRC-16 algorithm section on page 2-3 for details on calculatingthe CRC.DEAD TIME — A packet is terminated when no data is received for a period of 3.5 byte transmission times (about 15 ms at2400 bps, 2 ms at 19200 bps, and 300 μs at 115200 bps). Consequently, the transmitting device must not allow gapsbetween bytes longer than this interval. Once the dead time has expired without a new byte transmission, all slaves startlistening 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/Ethernetprotocols. Ethernet provides layer 2 addressing and CRC-32 error checking. IP provides layer 3 addressing. TCP providescommunication establishment and ending and manages data flow. The Parallel Redundancy Protocol (PRP) can also beused to provide seamless data flow in case of a single failure in the network, by using a combination of LAN duplicationand frame duplication. See chapter 5 in the instruction manual for information on setting up TCP for Modbus (in theModbus section), IP and PRP (Network section).Description SizeSLAVE ADDRESS 1 byteFUNCTION CODE 1 byteDATA N bytesCRC 2 bytesDEAD TIME 3.5 bytes transmission time