Atlas Robotics
Hardware InterfacesIntermediate

What is Modbus RTU? Industry's most common request-response protocol

Atlasbot · 16/8/2026 · 11 min read

What is Modbus RTU? Industry's most common request-response protocol
Master asks each slave in turn according to polling model

RS485 solves the problem of "how to transmit long-distance signals without interference", but it does not itself define the meaning of the data transmitted — a higher-layer protocol is needed so that the two devices understand the same "language". Modbus RTU is the most popular protocol for this, running directly on top of the existing RS485 (or RS232) physics.

Key concepts

Modbus RTU operates according to the master-slave question-answer (polling) model: there is exactly one device master (usually a PLC or control computer) that actively sends requests, devices slave (sensors, motor drivers, inverters...) only respond when asked for the correct address. me — the slave never sends data arbitrarily.

Each slave device has an address (1-247) and exposes its data in the form of numbers thanh ghi (register) are numbered — for example register 40001 could be "current motor speed", register 40002 could be "temperature". Master sends attached request function code (opcode, for example reading a register or writing a register) to manipulate the correct type of data needed.

Structure of a Modbus RTU frame

| Slave address | Function code | Data | CRC (error checking) |
|     1 byte     |    1 byte     | N byte  |       2 byte        |

In short: Modbus RTU does not replace RS485 — it is a protocol that runs on top of RS485, defining request/response packaging and register numbering, helping devices from different brands still understand each other if they "speak" Modbus.

How it works

Master asks Slave 1: "Read register 40001 (speed)?"
Slave 1 replied: "1500 rpm"
Master asks Slave 2: "Read register 40001 (speed)?"
Slave 2 replied: "1480 rpm"
... (repeat sequentially, no slave can arbitrarily interrupt)

Example register reading using a popular Modbus library (assumed on a microcontroller):

uint16_t result[2];
// Read 2 holding registers starting from address 0, from the slave with address 1
modbus_read_holding_registers(slave_addr=1, start_reg=0, count=2, result);

Technical details

Formulas

Because the master must ask each slave sequentially (without an arbitration mechanism like CAN), the overall system update rate decreases linearly with the number of slaves:

Time of 1 polling cycle ≈ N slaves × (request time + response time + transfer delay)

For example: 10 slaves, each question and answer round takes ~20ms (including DE/RE transfer delay)
Time of 1 polling cycle ≈ 10 × 20ms = 200ms
→ Each slave is only updated with new data about 5 times/second

This is why Modbus RTU is not suitable for data that needs to be continuously updated at hundreds of Hz (like motor speed PID loops) when the number of slaves is large — the more slaves, the lower the update frequency per slave.

Parameters

The most common function codes in Modbus RTU:

Function codeNameFunction
01Read CoilsRead multiple status bits (on/off)
03Read Holding RegistersRead multiple 16-bit registers
06Write Single RegisterGhi 1 thanh ghi
16 (0x10)Write Multiple RegistersRecord multiple registers at the same time

Range register address numbering convention: 0xxxx = Coils, 1xxxx = Discrete Inputs, 3xxxx = Input Registers, 4xxxx = Holding Registers — the number displayed in the document (eg: 40001) is different from the actual address sent on the wire (eg: 40001 → physical address 0x0000), see Common Errors section.

Register / Bit / Byte

The 2-byte CRC field at the end of the frame uses the CRC-16/MODBUS (0xA001 polynomial) algorithm, sent in the order low byte first (low byte first) — as opposed to the high byte first order common in many other protocols. The receiving device automatically recalculates the CRC on the entire frame just received and compares it with the 2 attached CRC bytes — if there is a mismatch, the entire frame is discarded, with no response (other than returning an explicit error), causing CRC errors to sometimes be mistaken as "device not responding".

Practical applications

Automatic charging stations for AMR often use Modbus RTU so that the central controller of the charging station periodically asks many charging compartments (each compartment is 1 slave) about voltage, charging current, and which robot is charging - an update frequency of several times/second is completely enough for monitoring the charging status, without needing high speed like a control loop motor. This is exactly the type of application Modbus RTU is most suitable for: many devices, slow data changes, no need for ultra-low latency — in contrast to CAN for real-time control loop discussed in the previous article.

Practical example

Request to read 2 registers from slave address 1, starting from address 0:

Outgoing bytes (hex): 01 03 00 00 00 02 C4 0B
                    │  │  └──┬──┘ └──┬──┘ └──┬──┘
                  slave FC start count CRC (low byte first)
                    =1  =03  =0      =2

Feedback from slave (hex): 01 03 04 05 DC 00 0A 38 9C
                          │  │  │  └────┬────┘ └──┬──┘
                        slave FC byte  2 gia tri  CRC
                         =1  =03 count  16-bit
                                =4  = 1500, 10

05 DC (hex) = 1500 (decimal) — exactly matches the value "1500 rpm" in the example in the Principle of Operation section. Reading raw bytes directly like this is an important debugging skill when the Modbus library reports ambiguous errors — comparing the actual received bytes with the standard frame structure helps determine exactly where the error lies.

Common mistakes

  • Mistaking the address displayed in the document with the actual address sent on the wire — register "40001" in the device documentation usually corresponds to the actual address 0x0000 (minus 40001 and the sequence number starts from 0) — incorrect addition/subtraction of 1 causes the wrong reading to the adjacent register.
  • CRC error due to transmission noise — the frame is completely destroyed, the slave does not respond at all — it is easy to mistakenly think that the slave is hung or lost connection when it is just a frame error due to instantaneous noise, which usually clears up on its own the next time it asks.
  • Duplicate slave addresses on the same bus — 2 devices with the same address will respond to the same request, causing signal conflicts on the RS485 bus — always ensure each slave has a unique address when configuring.
  • Send unsupported device function code — device returns exception response code instead of normal data — need to check device documentation to know exactly which function codes are supported before calling.

Conclusion

Modbus RTU is the most popular "common language" among industrial devices thanks to its simplicity, ease of deployment, and run on the existing RS485/RS232 platform — suitable for monitoring/configuring multiple devices with moderate update frequency, not suitable for high-frequency real-time control loops. This is also the penultimate article in the Hardware Communication section — the last article will talk about Ethernet, the high-speed network standard that is increasingly popular in modern industrial robots.

Get new articles and lessons by email

When a new technical article or course module is published, Atlas Robotics sends you a short email. No spam.

Unsubscribe any time with the link in each email. See our Privacy policy.

What is Modbus RTU? Industry's most common request-response protocol — Atlas Robotics