Industrial Communication: Modbus RTU/TCP, RS-485, CAN and OPC UA
Test rigs connect dynamometer controllers, drives, power meters and PLCs over a handful of standard links. Most problems are simple once you know the conventions: which register numbering the manual uses, which word order a 32-bit float has, and whether the RS-485 line is terminated and biased. This article collects those conventions in one place.
Key takeaways
- Modbus holding register 40001 is address 0 in the protocol (function 03); manuals mix 0- and 1-based numbering.
- A 32-bit float spans two 16-bit registers; word order varies (ABCD, CDAB, BADC, DCBA): try swaps if values look absurd.
- RS-485: daisy-chain topology, 120 Ω termination at both ends, failsafe biasing, common ground reference, up to 32 unit loads and about 1,200 m at low baud rates.
- Modbus RTU frames are separated by 3.5 character times of silence; at 19,200 baud reading 20 registers takes about 30 ms.
- CAN trades speed for distance (1 Mbit/s to about 40 m, 125 kbit/s to about 500 m); OPC UA provides secure, modelled data over Ethernet.
1. Modbus
| Function code | Action | Data |
|---|---|---|
| 01 | Read coils | Bits (outputs) |
| 02 | Read discrete inputs | Bits (inputs) |
| 03 | Read holding registers | 16-bit words (read/write) |
| 04 | Read input registers | 16-bit words (read only) |
| 05 / 06 | Write single coil / register | |
| 15 / 16 | Write multiple coils / registers |
| Reference (manual) | Table | Protocol address |
|---|---|---|
| 00001–09999 | Coils | 0–9998 |
| 10001–19999 | Discrete inputs | 0–9998 |
| 30001–39999 | Input registers | 0–9998 |
| 40001–49999 | Holding registers | 0–9998 |
Example timing at 19,200 baud reading 20 registers: request 4.6 ms, response 25.8 ms, gaps 4.0 ms → about 34 ms per poll before device response delay.
2. RS-485 wiring
- Twisted pair with shield; connect signal ground (common) between devices.
- Termination 120 Ω at both ends; failsafe bias resistors at one point so the idle line is defined.
- Unique addresses 1–247; all devices at the same baud rate, parity and stop bits.
- USB-to-RS-485 adapters: check automatic direction control and isolation.
3. CAN and OPC UA
| CAN bit rate | Approx. max bus length |
|---|---|
| 1 Mbit/s | 40 m |
| 500 kbit/s | 100 m |
| 250 kbit/s | 250 m |
| 125 kbit/s | 500 m |
| 50 kbit/s | 1,000 m |
OPC UA runs over Ethernet with encryption, user authentication and an information model (variables with units, ranges and structure). It suits connecting PLCs, data acquisition and higher-level systems without vendor-specific drivers.
4. Calculators
Modbus float decoder and poll time
5. Self-test: check your understanding
Pick an answer to see the explanation. Numerical answers are accepted within the stated tolerance (±3 % unless noted).
6. References and further reading
- Modbus Organization, Modbus Application Protocol Specification V1.1b3 and Modbus over Serial Line V1.02.
- TIA/EIA-485-A, Electrical Characteristics of Generators and Receivers for Balanced Digital Multipoint Systems.
- ISO 11898-1/-2, Road vehicles — Controller area network (CAN).
- IEC 62541, OPC Unified Architecture.