Modbus tutorials
Each tutorial has goals, prerequisites, numbered steps with expected results, common errors and a cleanup. Every command and result comes from real runs of the PDComm Modbus SDK and simulators. Check the background pages listed at the top of each tutorial before you start.
| Order | Tutorial | What you get | What you need |
|---|---|---|---|
| 1 | Observe addresses and frames | Manual address conversion, bit packing, exceptions, TCP/RTU/ASCII frames and CRC/LRC errors | Headless simulator |
| 2 | A closer look at the first TCP exchange | SDK layout, API ownership and threading rules, lost connections | C++ or C# console |
| 3 | The 19 function codes and diagnostics | Every function code, diagnostics sub-functions, listen-only mode, broadcasts | Headless simulator |
| 4 | RTU and ASCII communication | Serial configuration, raw frames, CRC fault injection, real devices | Virtual serial ports |
| 5 | TCP-to-serial gateway | Unit route table, exceptions 0A and 0B | Virtual serial ports |
| 6 | Modbus/TCP Security | Role certificates, per-role permissions, TLS failures, CRLs | OpenSSL 3 |
| 7 | Build a test workflow with the simulators | GUI server, projects, scenario regression tests, MCP | GUI simulator, jq |
| 8 | Diagnose failures and report them | Failing-layer triage, diagnostic log analysis, support request | C++ console, jq |
If you’re new, finish the quickstart, then do 1, 2 and 3 in order. Continue with 4 and 5 for serial devices and with 6 for secure connections.
The commands are written for macOS and Linux shells. On Windows, programs and libraries end in .exe and .dll, and you set environment variables in PowerShell’s $env: form.