Modbus RTU and TCP Register Lab
Read/write safe test registers and compare serial RTU framing with TCP transport.
Topology and objective
RTU: master → RS-485 transceiver → slave; TCP: client → Ethernet/Wi-Fi server.
Hardware and tools
- Supported development board
- USB data cable
- Current-limited supply
- Serial monitor and logic analyser when applicable
Security and RF safety
- Do not connect the lab to production machinery.nUse isolation and termination for longer RS-485 runs.nAllowlist writable registers and ranges.
Practical procedure
- Use an isolated low-voltage test slave.nSet unit ID, baud, parity and register map.nRead holding/input registers.nWrite only a designated test register.nCapture CRC/exception response or TCP transaction ID.
Telemetry / payload
{"unit":1,"function":3,"address":100,"quantity":2}Starter code / config
RTU: 01 03 00 64 00 02 CRCnTCP: MBAP header + function/dataExpected results
| Checkpoint | Expected | Tool |
|---|---|---|
| Read | Values match slave simulator | Modbus clientnException |
Troubleshooting
| Symptom | Check | Action |
|---|---|---|
| Timeout | Check A/B polarity, baud, parity and unit | Correct physical/settingsnWrong value |
Local-only sandbox
Commands & telemetry simulator
Send command
Simulator ready. No network connection is used.
