What is Modbus Protocol? From Serial to TCP/IP

In industrial automation, how do controllers, sensors, and actuators from different brands "talk" to each other? The answer often points to the same name: Modbus protocol. Since its birth in 1979, Modbus has become the de facto standard for industrial communication due to its simplicity, openness, and ease of use. This article will delve into the core principles of Modbus, its transmission methods, and the modern application of Modbus TCP/IP.

Part 1: What is Modbus Protocol?

Modbus is a master-slave architecture communication protocol widely used in industrial control. Through this protocol, controllers can communicate with each other or with other devices via networks (such as Ethernet).

Its working model is very clear:

  • Master Device (Modbus Master) : Initiates queries and operations. Typical examples are industrial PCs, industrial controllers, and HMIs (Human-Machine Interfaces).

  • Slave Device (Modbus Slave) : Responds to master device requests. Typical examples are PLCs, variable frequency drives, smart instruments, and I/O modules.

The communication process follows three steps:

  1. The master device sends a request command to a specific slave device.

  2. The slave device analyzes and processes the request, then returns result data.

  3. If any error occurs (e.g., unsupported function code, incorrect data address), the slave device returns an exception function code.

This question-and-answer model is stable and reliable, with the master device fully controlling the bus to avoid data collisions.

Part 2: Three Core Features of Modbus Protocol

Why has Modbus endured among numerous industrial protocols? These three features are crucial:

1. Standard, Open, and Royalty-Free

The Modbus protocol is completely open. Users can use it for free without paying license fees or infringing on intellectual property rights. This significantly reduces the integration cost of automation systems. Currently, over 400 manufacturers worldwide support Modbus, with more than 600 products supporting it—from Siemens and Schneider to countless smaller brands, it's hard to find a controller that doesn't support Modbus.

2. Supports Multiple Physical Interfaces and Media

Modbus is not picky about hardware. It supports various electrical interfaces:

  • Serial ports: RS-232 (short distance, point-to-point), RS-485 (long distance, multi-drop network)

  • Ethernet ports: via Modbus TCP/IP protocol

It can also transmit over various media: twisted pair, fiber optics, wireless (4G/5G, radio). This allows Modbus to be used for both legacy equipment retrofits and brand new high-speed networks.

3. Simple and Compact Frame Format

The Modbus message structure is easy to understand. Whether it's bit operations (reading switch states, coil states) or word operations (reading register values), there are corresponding function codes. Users and developers can get up to speed quickly, with very low development costs.

Part 3: Supported Modbus Function Codes (Partial)

Function codes are the core of Modbus commands—they tell the slave device what operation to perform. They can be divided into two categories:

TypeFunction Code (Decimal)Operation NameTarget Object
Bit Operations1 (01H)Read CoilsRead discrete output (DO) status

2 (02H)Read Discrete InputsRead discrete input (DI) status

5 (05H)Write Single CoilControl a single DO point

15 (0FH)Write Multiple CoilsControl multiple DO points simultaneously
Word Operations3 (03H)Read Holding RegistersRead device parameters, setpoints, current values (most common)

4 (04H)Read Input RegistersRead analog input (AI) values

6 (06H)Write Single RegisterModify a single parameter or setpoint

16 (10H)Write Multiple RegistersModify multiple parameters simultaneously

Understanding PDU and ADU:

  • PDU (Protocol Data Unit) : Pure function code + data, independent of transmission method.

  • ADU (Application Data Unit) : PDU plus additional address and error-checking information, adapted for different transmission media.

Part 4: Two Serial Transmission Modes: ASCII vs. RTU

When Modbus runs on serial ports (RS-232/RS-485), there are two main transmission modes. All devices must choose the same mode to communicate.

1. RTU Mode (Remote Terminal Unit) — Industry First Choice

  • Characteristic: Each 8-bit byte in the message is sent directly as hexadecimal. High data density.

  • Advantage: Higher transmission efficiency and throughput at the same baud rate compared to ASCII mode. The choice of over 95% of industrial field devices.

  • Frame Structure: Continuous character stream, with frames separated by a silent interval of at least 3.5 characters. Each byte includes 1 start bit, 8 data bits, 1 parity bit (optional), and 1 stop bit.

  • Error Checking: Uses 16-bit CRC (Cyclic Redundancy Check), high reliability.

2. ASCII Mode — Standby for Special Scenarios

  • Characteristic: Each 8-bit byte in the message is split into two ASCII characters for transmission. Example: Byte 0x5B is encoded as characters '5' (0x35) and 'B' (0x42).

  • Advantage: Human-readable characters, easy for debugging and inspection. Allows character intervals of up to 1 second, with looser timing requirements.

  • Disadvantage: Transmission efficiency is about half that of RTU mode, as each data byte requires two characters to represent.

  • Frame Structure: Starts with colon : (0x3A), ends with carriage return and line feed CRLF (0x0D + 0x0A). Uses LRC (Longitudinal Redundancy Check).

In a nutshell: RTU is the performance-first production mode, ASCII is the debugging-first compatibility mode. In real-world projects, over 95% of serial Modbus devices use RTU mode.

Part 5: Modbus TCP/IP — Embracing the Industrial Ethernet Era

With the development of the Industrial Internet, Modbus has evolved an Ethernet version: Modbus TCP/IP.

How is it different from serial Modbus (RTU/ASCII)?

FeatureModbus RTU/ASCII (Serial)Modbus TCP/IP (Ethernet)
Physical LayerRS-232, RS-485Standard Ethernet (RJ45, fiber, wireless)
Communication MethodMaster-slave polling, question-answerClient/Server, supports concurrency
Addressing MethodSlave address (1-247)IP address + Unit Identifier
Message StructureADU includes address + CRC/LRCADU removes CRC, adds MBAP header
Error CheckingCRC (RTU) or LRC (ASCII)Handled by underlying TCP/IP
Typical ApplicationLocal connection of PLCs, instruments, drivesHost monitoring, cloud SCADA, cross-network integration

Unique Advantages of Modbus TCP/IP

  1. Higher Communication Speed: Ethernet supports 10/100/1000Mbps, much faster than serial's 115.2kbps.

  2. Supports Multiple Masters Concurrently: Unlike serial which allows only one master to poll, multiple clients (e.g., HMI, SCADA, ERP system) can simultaneously access the same Modbus server device.

  3. Long Distance and Networking: Through industrial Ethernet switches, fiber optics, and 4G/5G routers, Modbus communication can easily span across workshops, factories, or even cities.

  4. Simpler Message Structure: Modbus TCP/IP removes the CRC check (handled by TCP/IP) and adds a 7-byte MBAP header (for transaction, protocol, length, and unit ID), making the structure cleaner.

Typical Modbus TCP/IP Application Scenarios

  • Factory-level SCADA monitoring systems collecting data from multiple PLCs via Ethernet.

  • Remote operation centers reading Modbus TCP instrument data from remote pump stations via VPN + 4G network.

  • Acting as a protocol for edge gateways to interface with cloud platforms in Industrial IoT (IIoT) deployments.

Part 6: How to Choose — Serial Modbus or Modbus TCP/IP?

This is a common question in real projects. Here's a quick decision reference:

ScenarioRecommended SolutionRationale
Inside-panel connection (PLC to drive, instrument)Modbus RTU over RS-485Low cost, good noise immunity, simple wiring, suitable for multi-drop within dozens of meters
Single industrial PC collecting data from dozens of distributed devicesModbus RTU over RS-485Simple polling, no network configuration needed
Cross-workshop, cross-factory data collectionModbus TCP/IPCan use existing Ethernet, no signal attenuation over long distances, supports switch expansion
Multiple systems accessing same device simultaneously (HMI + SCADA + MES)Modbus TCP/IPSupports multiple concurrent clients, no queuing
Legacy serial device access to EthernetSerial-to-Ethernet gatewayEncapsulates RTU protocol into TCP/IP, protecting existing investment
Remote collection via 4G/5G wirelessModbus TCP/IPWireless networks natively support TCP/IP, direct traversal

Best Practice: In new projects, consider Modbus TCP/IP as the backbone network, while continuing to use lower-cost RS-485 Modbus RTU at the end nodes (e.g., individual sensors, small actuators), aggregated through a gateway. This hybrid architecture balances cost, performance, and scalability.

Part 7: Summary

The fundamental reason Modbus protocol has endured for over four decades is its simplicity, openness, and "good enough" nature. Whether you're maintaining legacy equipment or designing a brand new smart factory, Modbus is almost always the "least bad" choice.

  • Need simple, reliable point-to-point or bus communication? Choose Modbus RTU over RS-485.

  • Need high speed, networking, multiple concurrent masters? Choose Modbus TCP/IP.

  • Need debugging capability or compatibility with special devices? Keep Modbus ASCII as a backup.

E-Marketplace
Contact Information
Email: marketing@movingcomm.com
WhatsApp: +852 46409121
WeChat: +86-18077905372
Shenzhen Movingcomm Technology Co., Ltd. A trusted partner for network communication devices and solutions
在线表单
邮箱验证
Subscribe
*
Submit
Copyright ©2026 - Shenzhen Movingcomm Technology Co., Ltd
Download Materials