MODBUS TCP
The Language of Industrial Communication: What is the MODBUS TCP Protocol?
Modbus is one of the most established and widely used protocols in the world of industrial automation, enabling devices to communicate with each other. Developed by Modicon in 1979, this protocol has evolved into Modbus TCP by moving onto the Ethernet infrastructure, becoming an indispensable part of IIoT (Industrial Internet of Things) systems today.
1. What is Modbus TCP?
Modbus TCP is a variant of the standard Modbus protocol transmitted over the TCP/IP protocol stack. It uses the Ethernet physical layer instead of traditional serial communication (RS-485/RS-232). This allows data to be carried at much higher speeds and over long distances via local area networks (LAN) or the internet.
Key Features:
-
Client/Server Architecture: The device requesting data is called the "Client," and the device providing the data is called the "Server."
-
Port 502: Modbus TCP communication standardly takes place over port 502.
-
Speed and Flexibility: Thanks to Ethernet speeds (10/100/1000 Mbps), thousands of data points can be read within milliseconds.
2. Modbus TCP Packet Structure (ADU)
The biggest difference that sets Modbus TCP apart from its serial versions (RTU) is the use of a header called the MBAP Header (Modbus Application Protocol) instead of an error check code (CRC). Since the Ethernet layer already performs its own error checking, an additional CRC code is not required.
MBAP Header Components:
-
Transaction Identifier (2 Bytes): Ensures matching between the client and the server.
-
Protocol Identifier (2 Bytes): Always 0 (represents the Modbus protocol).
-
Length (2 Bytes): Specifies the length of the remainder of the message.
-
Unit Identifier (1 Byte): Used to access sub-devices behind a gateway.
3. Data Types and Register Structure
In the Modbus protocol, data is stored within four basic tables:
| Data Type | Access | Description |
| Coils (0x) | Read/Write | Digital outputs (On/Off - 1 Bit) |
| Discrete Inputs (1x) | Read Only | Digital inputs (Buttons, sensors - 1 Bit) |
| Input Registers (3x) | Read Only | Analog inputs (Temperature, pressure - 16 Bit) |
| Holding Registers (4x) | Read/Write | Configuration and data storage (16 Bit) |
4. Advantages of Modbus TCP
-
Universality: Supported by almost all PLC, HMI, SCADA, and sensor manufacturers.
-
Low Cost: Easily established using standard Ethernet cables and switches.
-
Ease of Integration: IIoT Gateway devices like Hubbox can easily convert Modbus TCP data into modern protocols like MQTT or OPC UA.
-
Distance: Access to devices kilometers away can be achieved using fiber optics or wireless bridges.
5. Security Note
The Modbus TCP protocol does not include encryption or authentication by default. Therefore, the use of a VPN (Virtual Private Network) is essential for protecting data in critical fields. Hubbox Connect devices protect your Modbus TCP traffic by placing it inside a secure VPN tunnel, safeguarding it against attacks from the outside world.