Modbus – a versatile and proven communication protocol

Data monitoring and analysis
Data monitoring and analysis

BITMOTECO Machine Monitoring

Our modular condition monitoring system for production supports various communication protocols.

  • ROI in 6 months

  • Basic system for further optimisation

  • Ready to use in no time

  • Suitable for every machine

  • Data sovereignty without a cloud service

Arrange a demo appointment now to coordinate your test operation.

Two different communication interfaces

Modbus is a versatile and proven communication protocol that is widely used in industrial automation as well as other applications, as it enables easy and efficient data exchange between devices on a network. The two main variants, Modbus TCP and Modbus RTU, differ in transmission technology and frame structure, so they can meet different application areas.

Modbus TCP

The communication interface “Modbus Transmission Control Protocol” and is a variant based on the Internet Protocol (IP). It uses the standard TCP/IP network found in most modern industrial and commercial networks. In addition, data can be transmitted via Ethernet or wireless Wi-Fi connections, which ensures fast and reliable communication. In the interface protocol, data is transferred in the server-client model in the form of Ethernet frames. These frames contain the commands and data of the interface that are exchanged between a client (e.g. a PC) requesting the data and a server (e.g. a controller). Data is transmitted via port 502, which allows for easy integration into existing network infrastructures.

The advantage of Modbus TCP lies in its simplicity and interoperability. Since it is based on TCP/IP, it can easily communicate over LANs, WANs, or the Internet. It is also well suited for applications where fast and reliable data transmission is required, such as industrial automation and building automation.

Modbus RTU

Another communication interface, the “Modbus Remote Terminal Unit”, is a serial variant of the protocol. Unlike Modbus TCP, which uses Ethernet, Modbus RTU uses a serial interface such as RS-232 or RS-485 for data communication. In this case, the transmission of data takes place in the form of binary values. This makes them more efficient, as there is no need for extensive header information, as is the case with Modbus TCP. Communication occurs in a master-slave model, with the master sending the commands and the slaves receiving the data or responding to the commands with data.

One of the main advantages of this communication interface is the robustness of serial communication, which is consequently advantageous in harsh industrial environments. The short data transfer time and easy cabling make it a practical choice for applications where a longer distance between devices is required, such as in large factories or buildings.

Modbus RTU-over-TCP

The third communication interface presented in this article is called “Modbus RTU encapsulated in TCP” and is another variant of the Modbus protocol. Their main purpose is to transport serial RTU traffic over a TCP/IP network. The serial data is encapsulated in TCP/IP packets and then sent over the Ethernet. This approach makes it possible to take advantage of both protocol variants. To use this interface, a so-called “Modbus Gateway” is usually used. A gateway is a device or software that is positioned between the Modbus TCP master and the serial RTU slaves. It takes on the task of converting the RTU messages into TCP/IP packets and vice versa. This allows RTU devices to be seamlessly integrated into a TCP network without the need for a complete transition to Modbus TCP.

Modbus RTU/TCP Network with Gateway
Modbus RTU/TCP Network with Gateway

Thus, the use of this communication interface offers some advantages. For one, existing Modbus RTU devices can continue to be used without having to replace them with Modbus TCP-enabled devices. Accordingly, this saves time and consequently also costs for a complete migration. On the other hand, RTU devices communicate over long distances in a TCP/IP network, as communication takes place via Ethernet. This is particularly advantageous in large industrial plants, where the cabling of purely serial interfaces proves to be problematic. However, it is important to note that Modbus RTU-over-TCP may not work as efficiently as, for example, a pure Modbus TCP, as additional overhead data is generated by the TCP/IP packaging. Therefore, it is advisable to consider performance as well as latency when implementing Modbus RTU-over-TCP and, if necessary, to take appropriate measures to ultimately optimize efficiency.

Which variant is preferable?

The choice between the different variants depends mainly on the network infrastructure already available as well as the specific requirements of an application. For example, if fast and reliable communication via Ethernet or one of the IEEE 802.11 Wi-Fi standards (WLAN) is required, Modbus TCP is the appropriate choice. On the other hand, if robust serial communication is needed in an industrial environment over long distances, Modbus RTU may be a better option. For the simple connection of serial devices to an existing TCP/IP network, it is worth considering simple gateways as well as Modbus RTU-over-TCP.

Would you like to learn more about communication protocols and the associated potentials for your application? Simply arrange a free initial appointment:

Commands and structure of data packets

The Modbus protocol supports various functions that make it possible to exchange data between a master/client device and slave/server devices. These can be divided into two categories depending on their type:

Reading Functions:

  • Function 01 (0x01) – Read Coil Status: Reads the status of digital outputs (coil registers).
  • Function 02 (0x02) – Read Discrete Input Status: Reads the status of digital inputs (discrete input registers).
  • Function 03 (0x03) – Read Holding Registers: Reads the values of holding registers used to store configuration data and control parameters.
  • Function 04 (0x04) – Read Input Registers: Reads the values of input registers used for analog input values or other status information.

Writing Functions:

  • Function 05 (0x05) – Write Single Coil: Writes a single digital output (coil register).
  • Function 06 (0x06) – Write Single Register: Writes a single value to a holding register.
  • Function 15 (0x0F) – Write Multiple Coils: Writes multiple values to successive digital outputs (coil registers).
  • Function 16 (0x10) – Write Multiple Registers: Writes multiple values to successive holding registers.

RTU Frame Setup

In this setup, communication takes place via a serial interface such as RS-232 or RS-485. The RTU protocol is binary and consists of the following parts:

[ Slave Address ] [ Function Code ] [ Data ] [ CRC ]

The first part, with the slave address, identifies the target device to respond to the request. The function code specifies which function to perform (for example, read or write data). When a request is made, the parameters required for the specific function follow, such as the desired register address or the data to be written. In the event of a reply, the requested data will then be located there. Finally, to ensure data integrity, a test value generated by the cyclic redundancy check (CRC) method is transmitted.

TCP Frame Setup

In this setup, communication takes place in the form of Ethernet frames. A Modbus TCP packet consists of an Ethernet header, an IP header, a TCP header and the Modbus data block, the structure of which corresponds to the Modbus RTU frame without the test value. The structure looks like this:

[ Ethernet Header ] [ IP Header ] [ TCP Header ] [ Modbus Datablock ]

The Ethernet header contains the MAC addresses of the source and destination devices. The IP header also contains the IP addresses of the source and destination devices. The TCP header contains the port numbers of the source and destination devices, with port 502 often used for Modbus TCP. Finally, the data block of the interface contains the Modbus function, data address, data length and, if applicable, the data itself.

Thanks to our know-how and our services, we can help you with your questions about communication protocols.

Learn more about our services!

Or simply arrange a free initial appointment:

How does the communication between the BITMOTECOsystem and the devices take place?

The BITMOTECOsystem can communicate bidirectionally with all Modbus TCP-enabled devices via Node-RED and the Modbus node available in it, directly via TCP/IP. For serial communication with devices that support Modbus RTU, an external gateway is required. This then translates between the serial protocol and an IP-based network protocol. For this purpose, for example, Modbus RTU-over-TCP can be used.

Hannover | Niedersachsen | Oldenburg | Osnabrück | Göttingen | Celle | Lüneburg | Hameln | Aurich | Leer | Diepholz | Emsland | Gifhorn | Uelzen | Cuxhaven | Hamburg | Bremen | Braunschweig |