Modbus RTU and Modbus TCP
Modbus is one of the simplest and most widely used industrial protocols: a client (master) reads and writes numbered registers and coils in a server (slave), over RS-485 or RS-232 as Modbus RTU or ASCII, or over Ethernet as Modbus TCP. PROFIBUS DP and IO-Link are the other fieldbuses most often met on the same machines. A serial line monitor with Modbus decoding, such as the Lineeye LE-3500XR(V2), shows each request and response with timing; a logic analyser with a Modbus decoder does the same at board level.
How Modbus Frames Work
- Request: the client sends the server address (1 to 247; 0 is broadcast), a function code and its data, for example a starting register and a count.
- Response: the addressed server returns the same address and function code with the data, or an exception: the function code with its top bit set (for example 0x83 for a failed 0x03) and an exception code.
- Integrity: RTU appends a CRC-16 (low byte first); ASCII appends an LRC and ends each frame with CR LF; TCP relies on TCP and has no checksum of its own.
- Timing (RTU): a silent interval of at least 3.5 character times marks the end of a frame, and a gap longer than 1.5 character times inside a frame makes it invalid. At 9600 baud, 3.5 characters is about 4 ms; above 19200 baud the specification recommends fixed values of 1.75 ms between frames and 750 µs between characters.
Function Codes You Will See Most
| Code | Function | Data Type |
|---|---|---|
| 0x01 | Read Coils | 1-bit read and write outputs |
| 0x02 | Read Discrete Inputs | 1-bit read-only inputs |
| 0x03 | Read Holding Registers | 16-bit read and write registers |
| 0x04 | Read Input Registers | 16-bit read-only registers |
| 0x05 | Write Single Coil | Sets one coil on or off |
| 0x06 | Write Single Register | Writes one holding register |
| 0x0F | Write Multiple Coils | Writes a block of coils |
| 0x10 | Write Multiple Registers | Writes a block of holding registers |
Registers are 16 bits, sent most significant byte first. Values wider than 16 bits, such as 32-bit floats, span two registers, and devices disagree about which register comes first: the most common cause of a reading that is almost right but scaled wrongly. Register numbering also differs: documents may use 40001-style numbers or zero-based addresses for the same register.
PROFIBUS DP and IO-Link
PROFIBUS DP runs on RS-485 at fixed rates from 9.6 kbit/s to 12 Mbit/s, with up to 126 addresses. Masters pass a token between them and poll their slaves cyclically, so a capture shows a regular pattern of request and response telegrams; a break in that pattern points to the failing station. At the higher rates, termination and stub length matter far more than on a Modbus network.
IO-Link (IEC 61131-9) is a point-to-point link between an IO-Link master port and one sensor or actuator, on a standard three-wire 24 V sensor cable. It runs at 4.8 kbit/s (COM1), 38.4 kbit/s (COM2) or 230.4 kbit/s (COM3), exchanging cyclic process data plus on-request parameters and events. A device falls back to plain switching (SIO mode) when no master is present.
Many machines also carry HART (digital FSK on a 4 to 20 mA loop), KNX in building control and EtherCAT on Ethernet; ZeroPlus lists decoders for these too.
Common Modbus Faults and How to Find Them
| Symptom | Likely Cause | What to Check |
|---|---|---|
| No response from a server | Wrong address, baud rate, parity or stop bits | Capture the request and confirm framing; the Modbus specification's default is 8 data bits, even parity, 1 stop bit, and no parity needs 2 stop bits, but many devices ship set to 8 data bits, no parity, 1 stop bit, so check the device settings |
| CRC errors on a working network | Missing termination, no bias resistors, or a ground problem on RS-485 | Look at the A and B lines on an oscilloscope; check one 120 Ω terminator at each end |
| Responses merge or split into odd frames | Inter-frame silence too short, often from a USB converter adding gaps or a client sending too soon | Measure gaps between characters and frames against 1.5 and 3.5 character times |
| Exception 02 (illegal data address) | Register numbering off by one, or 40001-style number used as an address | Compare the address in the request with the device register map |
| Value nearly right but wrong scale | Word order of a 32-bit value swapped, or a scaling factor missed | Decode both registers and try the other word order |
| Modbus TCP works, gateway to RTU does not | Unit ID in the MBAP header not mapped to the serial address | Capture both sides of the gateway and compare unit ID and server address |
Tools for Analysing and Testing Modbus
Watch tools monitor a live network. Drive tools take the place of the client or a server, or give you a known-good device to test against.
Serial Line Monitors
| Product | Role | Capability | Price ex VAT |
|---|---|---|---|
| Lineeye LE-2500XR(V2) Multi-Protocol Analyser | Watch Drive | Stand-alone analyser for RS-232C, RS-422/485 and TTL (UART, I2C, SPI) to 1 Mbit/s (1.544 Mbit/s half duplex); 100 MB capture memory; Modbus decoding; simulation and bit error rate testing | £1,170 |
| Lineeye LE-3500XR(V2) Multi-Protocol Analyser | Watch Drive | Same interfaces and capture memory, faster (to 3.15 Mbit/s half duplex, 2.048 Mbit/s full duplex), with trend statistics and buffer and program simulation modes; both models take optional boards for CAN FD, LIN, current loop and RS-530, V.35 and X.21 | £1,670 |
Both the LE-3500XR(V2) and the LE-2500XR(V2) include Modbus among their standard protocol measurements; the LE-3500XR(V2) adds higher speeds, trend statistics and buffer and program simulation modes. Other Lineeye monitors capture the RS-485 or RS-232 line with timing, so you can read Modbus frames from the hex view. See our RS-485 guide for wiring, termination and the full Lineeye range.
Logic Analysers With Fieldbus Decoding
| Product | Role | Capability | Price ex VAT |
|---|---|---|---|
| Saleae Logic 8 | Watch | 8 channels, digital and analogue; Modbus decoding in the Logic 2 software, on the logic side of an RS-485 transceiver | £405 |
| ZeroPlus LAP-C Pro Series | Watch | Logic analyser; ZeroPlus lists ModBus, PROFIBUS, IO-Link and HART decoders, so ask us to confirm which are supplied with your LAP-C Pro model | £925 |
| Acute TravelLogic 34-Channel | Watch | Logic analyser running Acute's decoder library, which includes ModBus and ProfiBus | £1,161.65 |
Modbus Interfaces for Test Set-Ups
| Product | Role | Capability | Price ex VAT |
|---|---|---|---|
| Trycom TRP-C37M ModBus Interface | Drive | Ethernet to RS-485 interface with hardware direction control, for linking Modbus TCP clients to RS-485 devices | £225 |
| Trycom TRP-C28H ModBus TCP Interface | Drive | Modbus TCP I/O module with 4 inputs and 4 AC relay outputs: a known-good server to test a client against | £225 |
Tell us your network, baud rate and what you need to capture and we will recommend a monitor or interface.
Frequently Asked Questions
What Is the Difference Between Modbus RTU and Modbus TCP?
RTU carries binary frames over a serial line, usually RS-485, delimited by silence and protected by a CRC. TCP carries the same function codes and data over Ethernet, with a 7-byte header in place of the address and CRC. Gateways translate between them.
How Many Devices Can Be on a Modbus RTU Network?
Addresses run from 1 to 247, but RS-485 sets the practical limit: 32 standard unit loads per segment, more with reduced-load transceivers or repeaters. Long networks also need termination at both ends and bias resistors.
Why Does My USB to RS-485 Converter Break Modbus RTU?
Some converters buffer characters and send them with gaps, or turn the transmitter round slowly. Modbus RTU uses gaps to find the end of a frame, so a long gap mid-frame splits it. Use a converter with automatic direction control and measure the timing with a line monitor.
Can a Logic Analyser Decode Modbus?
Yes, if you probe the logic side of the RS-485 transceiver (RO or DI pins) or use a differential probe on A and B. The decoder needs the baud rate and framing, then shows address, function code, data and CRC.
Is PROFIBUS the Same as Modbus?
No. Both often run on RS-485, but PROFIBUS DP uses token passing between masters, cyclic data exchange with configured slaves and fixed baud rates up to 12 Mbit/s. It needs its own decoder.
Where to Start with Modbus, PROFIBUS and IO-Link
More Protocols
By John Legg CEng, Director, Debug Store. Updated 12 November 2026.



