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.

Client and serverOne client polls up to 247 servers on a serial line
RTUBinary frames delimited by silence, CRC-16
ASCIIHex characters, colon start, LRC check
TCPPort 502, 7-byte MBAP header, no CRC
16-bit registersCoils, discrete inputs, input and holding registers
ExceptionsFunction code plus 0x80 and an error code

How Modbus Frames Work

Modbus RTU and Modbus TCP frames comparedModbus RTU frame: at least 3.5 character times of silence, a one-byte server address, a one-byte function code, data, and a two-byte CRC. Modbus TCP frame: a seven-byte MBAP header made of transaction ID, protocol ID, length and unit ID, then the function code and data, with no CRC because TCP checks integrity.RTUsilence3.5 charsAddress1 byteFunction1 byteData0 to 252 bytesCRC-162 bytesTCPTransaction2Protocol2 (0)Length2Unit1Function1 byteData0 to 252 bytesMBAP header (7 bytes)
Modbus RTU frames are delimited by silence on the line and end with a CRC. Modbus TCP wraps the same function code and data in a 7-byte MBAP header.
  1. 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.
  2. 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.
  3. 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.
  4. 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

CodeFunctionData Type
0x01Read Coils1-bit read and write outputs
0x02Read Discrete Inputs1-bit read-only inputs
0x03Read Holding Registers16-bit read and write registers
0x04Read Input Registers16-bit read-only registers
0x05Write Single CoilSets one coil on or off
0x06Write Single RegisterWrites one holding register
0x0FWrite Multiple CoilsWrites a block of coils
0x10Write Multiple RegistersWrites 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

SymptomLikely CauseWhat to Check
No response from a serverWrong address, baud rate, parity or stop bitsCapture 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 networkMissing termination, no bias resistors, or a ground problem on RS-485Look at the A and B lines on an oscilloscope; check one 120 Ω terminator at each end
Responses merge or split into odd framesInter-frame silence too short, often from a USB converter adding gaps or a client sending too soonMeasure 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 addressCompare the address in the request with the device register map
Value nearly right but wrong scaleWord order of a 32-bit value swapped, or a scaling factor missedDecode both registers and try the other word order
Modbus TCP works, gateway to RTU does notUnit ID in the MBAP header not mapped to the serial addressCapture 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

ProductRoleCapabilityPrice ex VAT
Lineeye LE-2500XR(V2) Multi-Protocol AnalyserWatch DriveStand-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.463,95
Lineeye LE-3500XR(V2) Multi-Protocol AnalyserWatch DriveSame 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€2.089,95

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

ProductRoleCapabilityPrice ex VAT
Saleae Logic 8Watch8 channels, digital and analogue; Modbus decoding in the Logic 2 software, on the logic side of an RS-485 transceiver€506,95
ZeroPlus LAP-C Pro SeriesWatchLogic analyser; ZeroPlus lists ModBus, PROFIBUS, IO-Link and HART decoders, so ask us to confirm which are supplied with your LAP-C Pro model€1.157,95
Acute TravelLogic 34-ChannelWatchLogic analyser running Acute's decoder library, which includes ModBus and ProfiBus€1.453,95

Modbus Interfaces for Test Set-Ups

ProductRoleCapabilityPrice ex VAT
Trycom TRP-C37M ModBus InterfaceDriveEthernet to RS-485 interface with hardware direction control, for linking Modbus TCP clients to RS-485 devices€281,95
Trycom TRP-C28H ModBus TCP InterfaceDriveModbus TCP I/O module with 4 inputs and 4 AC relay outputs: a known-good server to test a client against€281,95

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.