Industrial networks · Serial interfaces · CNC and PLC diagnostics
Modbus RTU: Protocol Fundamentals, RS-485 Connections and Industrial Equipment Diagnostics
Modbus RTU is a communication protocol used by controllers, variable-frequency drives, I/O modules, sensors and measuring instruments. This guide covers network architecture, message frames, addressing, register reading, QModMaster, passive monitoring and troubleshooting communication faults.
1. Purpose and Applications
Modbus RTU (Remote Terminal Unit) is the binary mode of the Modbus serial communication protocol. It standardizes requests, responses and access to device logic bits and 16-bit registers. The protocol exchanges process values, states and commands among industrial devices from different manufacturers.
Typical applications include reading a VFD’s operating frequency, output current and fault status; collecting signals from a remote I/O module; obtaining temperature, pressure or meter readings; and exchanging parameters between PLCs, operator panels and auxiliary CNC systems.
A conventional 24 V PNP inductive sensor, limit switch or 4–20 mA transducer is not itself a Modbus Slave. Its signal may be read by a PLC or remote I/O module. A sensor with its own Modbus RTU interface, however, can operate as an independent Slave device.
2. Modbus RTU, RS-485 and Modbus TCP: Key Differences
| Technology | What it defines | What to know |
|---|---|---|
| RS-485 | Electrical transmission over a differential line | Does not define registers, function code FC03 or the meaning of data |
| Modbus RTU | Frame structure, device addressing, read/write functions and CRC | Usually operates over RS-485; RS-232 is also possible |
| Modbus ASCII | Another serial Modbus encoding using ASCII characters and LRC | Not compatible with RTU on a port configured for the other mode |
| Modbus TCP | Modbus communication over TCP/IP | Uses IP addresses, usually port 502, and an MBAP header instead of an RTU CRC |
An RS-485 port does not prove that a device supports Modbus: it may use the manufacturer’s proprietary protocol. Conversely, a USB/COM port alone does not make a controller a Modbus device; for example, GRBL uses its own serial commands.
Dedicated Modbus TCP ↔ RTU gateways can connect different types of networks. A basic USB-to-RS-485 converter merely provides a serial port and does not automatically act as a protocol gateway.
3. Master, Slave and Network Architecture
A standard serial Modbus network has one Master that initiates requests and one or more Slaves that respond when addressed. More recent documents also use the terms Client and Server; however, Master and Slave are still common in equipment manuals covering RTU.
Each Slave must have a unique address from 1 to 247. Address 0 is reserved for broadcast messages, which do not receive responses. Addresses 248–255 are reserved. The number 247 is a protocol addressing limit, not a guarantee that 247 devices can share one physical RS-485 segment.
A classic RS-485 segment is generally designed around a load budget of at least 32 standard unit loads. Modern fractional-unit-load transceivers, repeaters and appropriate biasing can support additional nodes. The actual number depends on device specifications and the line design.
The Master typically follows this sequence: request to Slave 1 → response → request to Slave 2 → response, and so on. If no response arrives, it waits for a timeout and may retry. Two independent Masters must not operate on the same bus without a dedicated arbitration mechanism.
4. RS-485 Wiring: Cable, Termination and Biasing
The most common arrangement is two-wire RS-485 (half-duplex). All devices share one differential pair for transmitting and receiving but take turns communicating. Four-wire RS-485 uses separate transmit and receive pairs, so analyzer connections and topology differ.
Polarity and Signal Common
Manufacturers use markings such as A/B, D0/D1, Data−/Data+, and sometimes SG−/SG+. The meanings of A and B are not consistent across all manufacturers. Always check the device-specific polarity table and pinout; do not rely on matching terminal letters alone.
A design may also call for a signal reference conductor marked Common / SG / GND. This is not equivalent to protective earth (PE): GND, 0 V and PE must not be joined arbitrarily, especially between cabinets at different potentials. Galvanic isolation can help on long or noisy links. Shield routing and earthing must follow the grounding design and manufacturer instructions.
Termination and Fail-Safe Biasing
Termination resistors belong at the two ends of the trunk. For typical twisted-pair cable with a characteristic impedance of about 120 Ω, a 120 Ω resistor at each end is commonly used. Adding a terminator in the middle increases bus loading and may degrade communication.
Bias or polarization resistors establish a defined idle state when nobody is transmitting. Their locations and resistances must be designed for the entire network; installing several independent bias networks may introduce excessive loading.
A linear trunk with short stubs is preferred over an arbitrary star. Cable length, transmission speed, conductor size, cable quality and stub length must be considered together; there is no single universal “up to N meters” limit that fits every combination of devices.
5. Serial Communication Parameters
All nodes on a serial line must use compatible serial settings. These are configured on the controller and Slave devices; the computer does not choose them automatically.
| Parameter | Typical settings | Result if they do not match |
|---|---|---|
| Baud rate | 9600, 19200, 38400, 57600, 115200 bit/s | Incorrect decoding or no communication |
| Data bits | 8 for RTU | Incorrect byte framing |
| Parity | Even, Odd, None | Parity errors or lost frames |
| Stop bits | Usually 1 with parity; 2 without parity per the standard's recommendation | Serial communication errors |
| Slave ID | 1–247 | No response from the intended device |
| Timeout / retries | Chosen for message length, device response time and application | False timeouts or excessively slow diagnostics |
19200 8E1 means 19,200 bit/s, 8 data bits, even parity and 1 stop bit. 9600 8N1 means no parity and 1 stop bit. Some equipment uses 8N1, but it is neither the only nor a universally required setting. The official Modbus Serial Line guide recommends 2 stop bits when parity is disabled; actual settings must match the device.
Do not change baud rates or parity across a live machine simply to “find” a connection: changing a Slave’s settings can break its normal communication with the PLC.
6. Device Addresses and Register Addresses
Modbus uses two independent address concepts. The Slave ID identifies a physical or logical device on the bus, while the register address identifies a variable inside that device.
Slave ID 3, Function Code 03, Start Address 0, Quantity 2 reads two Holding Registers from device address 3. Another Slave may have identically numbered registers containing entirely different information.Device manuals may show addresses such as 40001, 40002 or 30001. These are human-readable data-area references, not complete numbers transmitted in the RTU address field. In common numbering, the first Holding Register, 40001, is transmitted as address 0x0000. Some manufacturers directly show zero-based addresses; others number registers from one. Check the particular device’s register map, its Addressing section and the software’s Base Addr setting.
7. Four Data Areas and Function Codes
| Modbus area | Size of one item | Read | Write | Typical purpose |
|---|---|---|---|---|
| Coils (0x) | 1 bit | FC01 | FC05 / FC15 | Software enable bit |
| Discrete Inputs (1x) | 1 bit | FC02 | No | Limit sensor state |
| Input Registers (3x) | 16 bits | FC04 | No | Current measurement |
| Holding Registers (4x) | 16 bits | FC03 | FC06 / FC16 | Parameter, setpoint or status |
The data-area name does not necessarily reveal the physical signal direction. A Holding Register might contain read-only diagnostic data, while a Coil might represent an internal software flag with no direct relay output. The device’s register map determines which function codes each address supports.
Common function codes are 01/02 for reading bits, 03/04 for reading 16-bit registers, 05/06 for writing one bit or register, and 15/16 for writing multiple items. Exclude writing functions when performing read-only diagnostics on a live machine.
8. RTU Frame Format and CRC Verification
Modbus RTU uses binary frames. A silent interval of at least 3.5 character times separates frames; a long gap within a frame (over 1.5 character times) makes it invalid under RTU rules. Above 19,200 bit/s, the specification recommends fixed intervals of 750 μs and 1.75 ms. The maximum RTU frame length is 256 bytes.
CRC16 detects accidental transmission errors, but it neither authenticates the sender nor provides cryptographic protection. The two CRC bytes are sent low byte first, then high byte.
Example: Reading Two Holding Registers
The Master requests two registers from Slave 1, starting at address 0:
01 03 00 00 00 02 C4 0B
| Bytes | Meaning |
|---|---|
| 01 | Slave ID = 1 |
| 03 | Read Holding Registers |
| 00 00 | Starting address 0 |
| 00 02 | Quantity: 2 registers |
| C4 0B | CRC16 (least-significant byte first) |
If the first register contains 1250 (04 E2) and the second contains 0 (00 00), the response contains two 16-bit values. Their actual engineering meaning (for example, 12.50 bar with a ×0.01 scale) comes only from the device manual.
Normal Response, Exception and Timeout
A normal response contains the original function code and the requested data. An Exception Response has the high bit of the function code set: a request using FC03, for example, may receive 0x83 and exception code 02, Illegal Data Address. A Timeout means no valid expected response arrived within the configured interval. Possible causes include a lost connection, wrong address or serial settings, CRC errors, missing power, incorrect polarity or an unavailable device.
9. Interpreting Values and Scaling
Modbus transports bits and 16-bit words; measurement units, signedness, scaling and multi-register data formats are defined by the device manufacturer.
| Data type | Size | Example |
|---|---|---|
| UINT16 | 1 register | 44784 interpreted as an unsigned integer |
| INT16 | 1 register | The same bits represent −20752 in two's complement |
| UINT32 / INT32 | 2 registers | Pulse counter, position or accumulated energy |
| FLOAT32 (IEEE 754) | 2 registers | Pressure of 12.5 or another fractional value |
For 32-bit values, Modbus itself does not standardize the order of the two 16-bit words. Devices may use High Word First or Low Word First; software may also expose alternative byte orderings. Incorrect interpretation can produce meaningless readings even when communication is fully functional.
Scaling example: a raw register value of 1250 with a factor of 0.01 bar represents 12.50 bar. On another device, the same number might mean 1250 rpm. A register map must therefore be read together with the data type, units, scaling, word order and write permissions.
10. Active Diagnostics with QModMaster
QModMaster is a free graphical Modbus Master application for RTU and TCP. It can manually read Coils, Discrete Inputs, Input Registers and Holding Registers, poll at a configured interval and display its own requests and responses in Bus Monitor. It is an active polling tool, not a passive analyzer for somebody else’s network.
Preparing a Separate Training Connection
- Connect an RS-485-capable Slave to a separate USB-to-RS-485 adapter; verify the pinout, signal reference and line termination.
- Install the adapter driver and identify its COM port in Windows Device Manager.
- In QModMaster, select Modbus RTU, the COM port and the documented baud / data bits / parity / stop bits settings.
- Enter the Unit ID, Function Code, start address and number of registers to read.
- Perform one read. If a normal response is returned, check values and CRC in the log before enabling a moderate periodic Scan.
- Compare the readings with the register map, scaling settings and the device’s local display.
If QModMaster reports Illegal Data Address, it has already received a response from the Slave: check the register range. If it reports a Timeout, first investigate the Slave address, physical wiring, COM port parameters and availability of the device.
11. Passive Monitoring of a Live Network
Active mode: the diagnostic computer acts as Master and sends requests itself. This is suitable for an isolated test bench or a specially prepared service connection without another Master.
Passive mode: the machine’s PLC remains the sole Master. A diagnostic analyzer receives and decodes the requests and responses already present on the bus, but does not transmit Modbus requests.
What Passive Monitoring Can Reveal
- Which Slave addresses the PLC polls and at what intervals.
- Which function codes and registers it requests and what the devices return.
- Whether responses, exceptions, CRC errors, repeated requests or long pauses are present.
- Which values change when equipment states change during normal operation.
Passive monitoring cannot retrieve a register that the existing Master never requests. The absence of Modbus frames does not prove that equipment is faulty: its interface may be unused, may run Modbus ASCII or a proprietary protocol, or its commands may be carried by 0–10 V signals and digital contacts.
Requirements for Safely Attaching an Analyzer
To observe a two-wire bus, use a separate receive connection appropriate to the existing topology. Before connecting, determine transceiver loading, biasing, termination, galvanic isolation, signal-reference potential and permitted stub length. Verify that the analyzer software does not transmit, but remember that software read-only mode does not make the electrical connection completely passive.
In critical installations, use a purpose-built isolated, high-impedance analyzer or a manufacturer-provided monitoring point. Attaching equipment to arbitrary terminals on an operating machine without verifying the electrical impact may disrupt communication with drives and I/O.
12. Diagnostic Software and Equipment
| Tool | Mode / use | Notes |
|---|---|---|
| QModMaster | Active RTU/TCP Master | Read/write in an authorized configuration; Scan and Bus Monitor for its own traffic |
| pyModSlave | Slave simulator | Training register map and simulated values |
| ModbusSniffer | Capture and decode RTU frames | Requires an electrically appropriate RX-only connection point; test on a bench first |
| Modbus Poll | Commercial Master software | Polling, logging and debugging; not a replacement for a passive sniffer |
| Wireshark | Analysis of network captures and saved dumps | Ordinary Ethernet capture does not show RS-485 COM traffic; a separate capture tool, bridge or supported capture format is needed |
| Moxa UPort 1150I | USB-to-RS-232/422/485 hardware converter | Provides a virtual COM port; it is not a standalone Modbus Master without control software |
QModMaster’s Bus Monitor displays traffic initiated by QModMaster itself. To observe requests sent by another PLC, you need an independent sniffer and an appropriate connection point. Windows normally cannot open one COM port from two independent programs at once without a special sharing mechanism; sharing the port still does not solve the problem of two Masters on one bus.
13. Step-by-Step Troubleshooting Workflow
- Identify the interface. Consult the manual to establish whether the device uses Modbus RTU, ASCII or another protocol, and whether RS-485 is active in the selected mode.
- Review the wiring diagram. Locate A/B or Data+/Data−, Common, shielding, terminators, bias sources and all bus nodes.
- Document the configuration. Record Slave ID, baud rate, parity, stop bits, register map, data types and permitted function codes.
- Select the diagnostic mode. Active polling may be appropriate for an isolated device; coordinated passive monitoring is usually preferable on a live line with an existing PLC Master.
- Capture the traffic. Preserve raw frames, timestamps, port settings, device IDs and the conditions in which the fault occurs.
- Compare the evidence. Distinguish transport errors from Modbus exceptions, PLC logic interlocks and physical actuator faults.
For reproducible troubleshooting, record the Master and Slave models and firmware versions, wiring diagram, CNC event log, and the time and circumstances of each fault. These details help compare normal and faulty bus behavior.
14. Common Faults and How to Distinguish Them
| Observation | Meaning | What to check |
|---|---|---|
| Timeout on every poll | No expected response | Slave power, address, baud/parity, RTU/ASCII mode, A/B, Common and cable integrity |
| Exception 01 response | Illegal Function | Whether the device supports that specific function code |
| Exception 02 response | Illegal Data Address | Data area, zero-/one-based addressing and valid register range |
| Exception 03 response | Illegal Data Value | Request format and allowed request-field values, not just register contents |
| CRC / framing / parity errors | Corrupted or incorrectly decoded frames | Noise, termination, polarity, serial settings and bus topology |
| Occasional missing responses | Unstable communication or delays | Cable quality, reference potentials, stubs, bus loading and timeouts |
| An “incomprehensible” numeric reading | Transport may be fine, but interpretation is wrong | UINT/INT/FLOAT, scaling, word order and register address |
| Faults begin after connecting a laptop | Physical bus interference or a second Master | Stop the test immediately, restore the original configuration and reassess the monitoring connection |
A Modbus Exception is a meaningful response from the device, whereas a Timeout only indicates that a valid expected response was not received. This distinction helps avoid confusing register-address problems with physical communication faults.
15. Practical Applications in CNC Systems
On an industrial CNC machine, Modbus RTU may connect an auxiliary-motor VFD, discrete I/O module, pressure instrument, energy meter, additional PLC or HMI panel. Synchronous axis control, meanwhile, is often handled through EtherCAT, SERCOS or other dedicated motion interfaces.
For example, a PLC may read spindle frequency, output current and fault code from a Modbus Slave and use those values for machine diagnostics. However, the presence of Modbus support in the VFD does not mean the CNC uses Modbus to control it: the spindle may receive FWD/REV commands through digital inputs and a 0–10 V speed reference. In that case, a passive RS-485 sniffer may observe no traffic at all.
Successful diagnostics require the actual control wiring, the software I/O map and the real communication interface. A Modbus register is only one possible source of status information; it does not replace electrical measurements, drive fault logs or Ladder logic analysis.
16. Safety, Limitations and References
Classic Modbus RTU has no built-in command authentication or encryption. Physical access to the bus, or logical access through an unsecured gateway, may let an unauthorized Master attempt to read or modify equipment parameters. Protection depends on network segmentation, controlling cabinet access, secure gateway configuration and operating procedures.
A write function may change a setpoint, operating mode, PLC output or drive behavior. Even read requests at excessive frequency can overload a slow Slave. Work on live machinery must follow a risk assessment, authorization by responsible personnel and electrical safety procedures. Modbus is not a functional-safety interface: E-stop, STO and safety interlocks must not be replaced by arbitrary Modbus commands.
Standards and Technical References
- Modbus Organization — Specifications and Implementation Guides (official documentation index).
- MODBUS over Serial Line Specification and Implementation Guide V1.02 — addressing, frames, timing and RS-485.
- MODBUS Application Protocol Specification V1.1b3 — function codes, data structures and exceptions.
- QModMaster — project and documentation.
- ModbusSniffer — application documentation.
- Moxa UPort 1100 Series User’s Manual — adapter configuration and RS-485.
Modbus RTU can support meaningful diagnostics only when the electrical interface, communication settings, register map and diagnostic device’s role on the network are known. Good troubleshooting separates electrical signaling, Modbus frame processing and PLC/CNC control logic.