
Modbus RTU and Modbus TCP
Modbus is a widely used communication protocol in industrial automation and data acquisition, originally developed by Modicon in 1979. Known for its openness, simplicity, and ease of implementation, Modbus supports multiple physical layers and network structures. The protocol has three main variants: Modbus RTU, Modbus ASCII, and Modbus TCP. This article focuses on Modbus RTU and Modbus TCP.

▶ Modbus RTU Protocol
Definition and Principles
Modbus RTU (Remote Terminal Unit) is a protocol based on serial communication, commonly using RS-485 and RS-232 as physical interfaces. It adopts a master-slave architecture: the master device (such as a PLC or host computer) initiates requests, while slave devices (such as sensors and actuators) respond passively.
Data Frame Structure
Modbus RTU frames use a compact binary format, structured as follows:
- Address field (1 byte): Specifies the target slave device, ranging from 1 to 247.
- Function code (1 byte): Defines the operation type, such as reading or writing registers.
- Data field (N bytes): Contains specific data (such as register addresses and values).
- CRC check (2 bytes): Cyclic Redundancy Check to ensure data integrity.
Communication Process
- The master device sends a request frame specifying the target slave and operation.
- The slave device receives, parses, and executes the operation, then returns a response frame.
- CRC checks are used throughout to guarantee reliable data transmission.
Advantages and Applications
- Simple, open standard with strong compatibility.
- Suitable for industrial automation, building automation, and energy monitoring, especially in scenarios requiring long-distance and interference-resistant serial communication.
- Supports up to 247 slave devices, making it ideal for small to medium-sized distributed systems.
Limitations
- Limited communication speed, typically not exceeding 115.2kbps.
- Requires dedicated serial wiring, leading to higher installation and maintenance costs.
- Lacks security mechanisms, making it unsuitable for large-scale or high-security systems.
▶ Modbus TCP Protocol
Definition and Principles
Modbus TCP is a network extension of the traditional Modbus protocol, encapsulated within TCP/IP and operating over Ethernet. It uses a client/server model, with the host computer as the client and field devices (such as PLCs and I/O modules) as servers.
Data Frame Structure
Modbus TCP frames mainly include:
- MBAP header (7 bytes): Contains transaction identifier, protocol identifier, length, and unit identifier.
- Function code (1 byte): Same as RTU, defines the operation type.
- Data field (N bytes): Contains operation-specific data.
Unlike RTU, Modbus TCP does not require CRC checks, as TCP/IP provides its own data integrity mechanisms.
Communication Process
- The client establishes a connection to the server via TCP port 502.
- The client sends a request frame, and the server parses and responds.
- The connection can be closed after communication or kept open for multiple exchanges.
Advantages and Applications
- Based on Ethernet, offering high communication speeds and supporting large-scale, long-distance networks.
- Leverages TCP/IP reliability and connectivity, facilitating integration with modern IT systems.
- Supports high-speed data access, suitable for SCADA, industrial IoT, and building automation applications requiring large data volumes.
- Easy to configure and expand, with broad support from industrial device manufacturers.
Limitations
- Requires Ethernet infrastructure and IP address management.
- For applications with extremely high real-time requirements, network latency and congestion must be considered.
▶ Summary
Both Modbus RTU and Modbus TCP are mainstream communication protocols in industrial automation. Modbus RTU is suited for traditional serial communication environments, offering high reliability and strong resistance to interference. Modbus TCP aligns with the trend toward industrial networking, supporting high-speed, long-distance, and large-scale device interconnection. Both protocols use master-slave or client-server architectures, function codes, and register mapping for data exchange, greatly enhancing interoperability among industrial devices.