Connectivity¶
Communication Example Pack¶
Communication Examples Index¶
Docs category: docs/public/examples/connectivity.md
This folder groups protocol-focused communication examples so they are easy to find and compare.
Included protocols:
modbus-tcpmqttopcuaethercat(mock-first + hardware handoff)ethercat_field_validated_es(field-tested EK1100 + EL2008 profile)gpio- composed
multi_driver(io.drivers = [...])
Why this folder exists¶
Most projects start with simulated or loopback, then fail during integration because protocol assumptions were never validated early. These examples isolate each protocol so teams can commission communication one layer at a time.
Recommended execution order¶
modbus_tcp/README.md- learn deterministic request/response register mapping and timeout policy.
mqtt/README.md- learn broker/topic boundaries and reconnect behavior.
opcua/README.md- learn runtime wire exposure and feature-gated build behavior.
ethercat/README.md- learn mock-first module chain validation, then hardware handoff.
ethercat_field_validated_es/README.md- apply a previously field-tested real-adapter profile for EK1100 + EL2008 output commissioning.
gpio/README.md- learn IEC bit mapping to GPIO lines, debounce, and safe-state defaults.
multi_driver/README.md- learn composed-driver commissioning and mutual-exclusion rules.
Common base layout in each example¶
trust-lsp.toml: project + runtime endpoint defaultssrc/main.st: minimal IEC program logicsrc/config.st: task/resource binding +VAR_CONFIG%I/%Qmappingio.toml: protocol-specific I/O backend profileruntime.toml: runtime profile (OPC UA example uses this directly)
Validation loop (all protocols)¶
Run from each protocol folder:
trust-runtime build --project . --sources src
trust-runtime validate --project .
trust-runtime ctl --project . io-read
Why this loop matters:
buildconfirms ST parses/type-checks and bytecode generation succeeds.validatechecks runtime + I/O schema before launch.io-readconfirms the control plane can read process image state.
Transport-gating notes (important)¶
- EtherCAT hardware transport (non-
mockadapter): - requires build feature
ethercat-wire - is only supported on unix targets in this build
- OPC UA wire server:
- requires build feature
opcua-wire - if
runtime.opcua.enabled = truewithout that feature, startup fails with a feature-disabled error
These notes are repeated in the protocol READMEs and in docs/guides/PLC_IO_BINDING_GUIDE.md.