PDComm Modbus features
The PDComm Modbus SDK ships as its own library (pdcomm_modbus_ffi) and executables, independent of the SECS/GEM SDK. An endpoint acts as a client, a server or a gateway, and you drive it entirely with JSON commands.
Components
Section titled “Components”| Component | Description |
|---|---|
| C ABI | include/pdcomm/modbus/pdcomm_modbus.h. Pass JSON commands to pdcomm_modbus_call. |
| C++ wrapper | Endpoint in pdcomm_modbus.hpp, header-only. |
| Qt and MFC adapters | QtEndpoint in bindings/qt, MfcEndpoint in bindings/mfc |
| .NET binding | Endpoint in bindings/dotnet/PDComm.Modbus |
| Simulator GUI | PDComm Modbus Simulator, with six workspace tabs for testing servers, clients and gateways |
| Headless simulator | pdcomm-modbus-headless, driven by JSON on standard input or by scenario files |
| MCP server | pdcomm-modbus-mcp, which exposes the same commands as MCP tools for AI tools |
The GUI, the headless simulator, the MCP server and the SDK share the same service code, commands, model and project format. Each process is still its own session: starting the MCP server doesn’t attach it to a GUI that’s already running.
Supported features
Section titled “Supported features”| Area | Support |
|---|---|
| Transports | Modbus TCP, RTU, ASCII |
| Roles | Client, server, TCP-to-RTU/ASCII gateway |
| Function codes | 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 15, 16, 17, 20, 21, 22, 23, 24, 43 (MEI 14) |
| Diagnostics sub-functions | 0, 1, 2, 3, 4, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20 |
| Security | Modbus/TCP Security: encrypted, authentication_only, role-based authorization, CRLs |
| Server data model | Four tables, file records, FIFO queues, device identification objects, server ID, exception status |
| Observation | The last 1000 requests and frames (trace), synthetic frame decoding (fault), diagnostics counters |
| Projects | Save and restore the configuration and data model as pdcomm.modbus.project version 1 JSON |
| Diagnostic log | Optional JSON Lines log (PDCOMM_LOG), off by default |
Sizes and timing
Section titled “Sizes and timing”| Item | Value |
|---|---|
| PDU | 253 bytes |
| ADU | TCP 260 bytes, RTU 256 bytes, ASCII 513 characters |
| Configured unit | 1–247 |
timeout_ms |
1–60000 |
ascii_timeout_ms |
1–60000, default 1000 |
turnaround_ms |
0–60000, default 100 |
| JSON command | 16 MiB per SDK call, 1 MiB per headless or MCP line |
trace |
Last 1000 entries |
fault input |
4096 bytes |
| TCP server connections | 32 at a time; closed after 120 seconds without traffic |
| Gateway queue | 64 requests; exception 06 when full |
Endpoint behavior
Section titled “Endpoint behavior”| Item | Behavior |
|---|---|
| TCP framing | The TCP transport uses the MBAP header. |
| Addresses | address takes IP:port. Your application resolves host names to IP addresses before it passes them. |
| Sending requests | Each request is sent once. Your application decides whether to send a timed-out request again; check the device state before you repeat a write. |
| Server unit | A server endpoint answers the unit in its configuration. |
| Threads | The SDK runs on your application’s threads. A server or gateway answers while your application keeps sending poll. |
| Register values | Registers are 16-bit integers. Your application combines two registers for a 32-bit value. |
| Default server exceptions | The default server answers MEI 13 (CANopen) and the user-defined function codes (65–72, 100–110) with exception 01. |
| RS-485 direction control | The operating system and the adapter switch the line direction. |
Check the features of a build
Section titled “Check the features of a build”Depending on the delivery profile, an SDK can include only some of TCP, RTU, ASCII and Security. Configuring a transport or security that the build lacks fails with Protocol is excluded from this build. Check at startup:
- C:
pdcomm_modbus_capabilitiesreturns an OR ofpdcomm_modbus_capabilitybits: TCP 1, RTU 2, ASCII 4, Security 8. A full build returns 15. - C:
pdcomm_modbus_abi_versionreturns0x00010001for this header. Stop if it differs from the header you built against. - JSON:
{"action":"capabilities"}returnstrueorfalseper transport plus the function code and diagnostics lists.
{"ok":true,"result":{"ascii":true,"canopen":false,"diagnostic_logging":true,"diagnostics":[0,1,2,3,4,10,11,12,13,14,15,16,17,18,20],"functions":[1,2,3,4,5,6,7,8,11,12,15,16,17,20,21,22,23,24,43],"logging_schema_version":1,"mei13":"opaque_extension","project_version":1,"protocol":"modbus","rtu":true,"security":true,"tcp":true}}Check the function codes and addresses of the device you connect in its manual.