Modbus TCP Basics
A concise practical guide to Modbus TCP concepts: clients, servers, unit IDs, function codes, registers, polling, and mapping pitfalls.
What Modbus TCP is
Modbus TCP is a simple industrial protocol that carries Modbus requests over TCP/IP, commonly using port 502. It is widely supported by PLCs, meters, drives, gateways, and test tools.
Client and server roles
The client initiates requests. The server responds with data or exception codes. In SCADA projects, the SCADA driver or gateway is often the client and the device is often the server.
Data areas
Modbus data is commonly described as coils, discrete inputs, input registers, and holding registers. Each area has different read/write behavior and function codes.
Mapping pitfalls
- Address offset differences: 40001 notation may map to zero-based address 0.
- Word order and byte order for 32-bit values.
- Signed vs unsigned interpretation.
- Scaling factors that are not documented near the register.
- Unit ID behavior through gateways.
Troubleshooting checklist
Start with link and IP reachability, then port 502, then unit ID, then function code, then address range, then data type interpretation. Do not debug screen bindings before proving the protocol request works.