Beckhoff TwinCAT to MQTT
Beckhoff TwinCAT 2 and 3 over ADS/AMS: variables by symbolic name, MAIN.fCycleTime, read through the AMS route to the target Net Id. Design it in the editor, validate it, build the package and run it.
Typical use case
A machine on a Beckhoff IPC exposing its PLC variables to a broker for monitoring, without an extra TwinCAT function block.
The TwinCAT ADS driver deploys and runs in this release of the Edge Runtime. It has been tested against a simulated target, not yet against a real one, so treat the first commissioning as the verification.
Configuration approach
Symbols by name
MAIN.fSpeed, GVL.bRunning: the names as they appear in TwinCAT, with the tag's data type.
AMS routing
Target Net Id and port (851 for the first PLC runtime); left empty, the runtime derives the Net Id from the host. The gateway's own Net Id must be added as a route on the target.
Quality travels with the value
A tag that stops being readable is published as such, never as a repeat of the last good number.
Build a Beckhoff TwinCAT to MQTT gateway
Create a project, define the device and its tags in the Edge Logic Editor, and download a runtime to test at the plant.