The Modbus protocol is a messaging structure developed by Modicon. It is used to establish master-slave/client-server communication between devices. Modbus has many protocol options. But the two most used are Modbus RTU (Remote Terminal Unit), Serial (RS-232 or RS-485) protocol or Modbus (TCP/IP) Transmission Control Protocol and Internet protocol. What’s the difference between the two? Although both protocols are similar, cost and speed set the two apart.
Modicon introduced the Modbus protocol to the market in 1979. Modbus RTU mode is the most common implementation, but Modbus TCP/IP is gaining popularity and preparing to surpass it. To bring Modbus into the 21st century, the open Modbus TCP/IP specification was developed in 1999. Modbus is an open standard and a widely used network protocol in industrial manufacturing environments. This is a universal link that hundreds of vendors have implemented and integrated into thousands of different manufacturing devices to transfer discrete/analog I/O and register data between control devices. MODBUS communication is always initiated from the master node to the slave node. Slave nodes will not communicate with each other and will not transmit data before receiving a request from the master node.
Coils starting from 00001, corresponding to on/off binary outputs, such as relays.
Input bits starting from 10001, corresponding to binary input (read only).
Input registers, starting at 30001, correspond to analog inputs (read only).
Holding registers, starting at 40001, correspond to simulation parameters that can be changed.
In contrast, Modbus RTU mode is the most common implementation, using binary encoding and CRC error checking. The RTU protocol is an efficient binary protocol in which each octet in the message contains two four-digit hexadecimal characters. Each message must be sent in a continuous stream. The format of each byte (11 bits) in RTU mode is: Coding system: 8-bit binary, bits per byte: 1 start bit, 8 data bits, the least significant bit is sent first, 1 bit is used for parity Done, 1 stop bit. MODBUS RTU packets are only used to send data. They do not have the functionality to send parameters such as point names, resolution, units, etc. Standard MODBUS RTU node addresses are 1-254, with 0 reserved for broadcast messages and only for writes. MODBUS on serial line systems may use different physical interfaces (RS485, RS232). TIA/EIA-485 (RS485) two-wire interface is the most common. As an additional option, an RS485 four-wire interface can also be implemented. The RS485-MODBUS configuration without repeaters has a relay cable through which the devices are connected directly (daisy chain). Backbone cables (also called “buses”) vary in length, but must be connected to line terminations at both ends. Repeaters can also be used between multiple RS485-MODBUS. The length of the trunk cable must be limited. The maximum length depends on the baud rate, cable (gauge, capacitance or characteristic impedance), number of loads on the daisy chain, and network configuration (2-wire or 4-wire). Typical cable lengths for this bus connection are up to 1000m and a typical baud rate is 9600 bps. Good cable selection, at least 22 gauge,
Modbus TCP/IP is simply Modbus RTU protocol with a TCP interface running over Ethernet. With Ethernet, you combine a universal, scalable global physical network (Ethernet) with a common network standard (TCP/IP) and the vendor-independent data representation Modbus. This protocol provides a truly open, accessible network that allows blocks of binary data to be exchanged between devices. For any device that supports TCP/IP sockets, there are switches and cables available for each device, making implementation simple. It remains fully compatible with any Ethernet infrastructure customers may have installed.
Ethernet is of course much faster and a little easier to troubleshoot. However, you probably don’t want to use Ethernet for Modbus communications. Probably too fast. TCP/IP is a common transport protocol on the Internet and is a set of layered protocols that provide a reliable data transfer mechanism between machines. Ethernet has become a standard for many systems, so it is no surprise that it has also become one of the standards for factory networking. Since Ethernet technology has been around for many years, it has evolved to an extent that the cost of implementing this network solution has become affordable.
Ethernet devices will get faster, but with many Modbus devices, speed isn’t entirely necessary. All those level sensors, temperature sensors, flow meters and other transmitters don’t need to report data very quickly. It is necessary to report the data every few seconds. Throughput is not a good reason to use RTU on Ethernet. The most basic difference between MODBUS RTU and MODBUS TCP/IP is that MODBUS TCP/IP operates on the Ethernet physical layer, while Modbus RTU is a serial level protocol. Modbus TCP/IP also uses a 6-byte header to allow routing. There are a lot of problems when trying to get an RS485 network to work. Compared to Ethernet devices, you have to deal with wire termination issues, network termination issues, and many more configuration issues. But overall, would you use a Modbus RTU device over Modbus TCP? Modbus TCP/IP is just a Modbus RTU protocol with a TCP interface running over Ethernet. So if you want to get your data fast and you want to move into the 21st century, Modbus TCP/IP is the way to go.