Skip to main content
Version: 3.0 (next)

TwinCAT Trigger Node

Overview​

The TwinCAT Trigger Node automatically initiates MaestroHub pipelines when an ADS device notification arrives from a Beckhoff TwinCAT PLC. Unlike the TwinCAT Read nodes, which read a value inside an already-running pipeline, the TwinCAT Trigger starts a new pipeline execution on each push from the PLC — enabling fully event-driven automation without polling.

The PLC pushes a new sample whenever the monitored symbol changes (on-change) or on a fixed cycle (cyclic), and each push carries a server timestamp.


Core Functionality​

What It Does​

1. Event-Driven Pipeline Execution Start pipelines automatically whenever the PLC pushes a new sample for the monitored symbol. Latency is bounded by the PLC's change-check cycle, not by any polling interval.

2. Two Notification Modes The underlying Device Notification function subscribes in either on-change mode (push only when the value changes) or cyclic mode (push every cycle time). The mode, cycle time, and batching delay are configured on the function — see Device Notification.

3. Automatic Subscription Lifecycle The subscription is created when the pipeline becomes enabled and torn down when it's disabled. The connector re-subscribes automatically after reconnects — no manual subscription management required.

4. PLC-Enforced Change Detection There is no connector-side deduplication. ADS notifications carry a server timestamp, and on-change is enforced by the PLC, so every delivered sample is a real change. This mirrors the OPC UA subscription model.


How TwinCAT Triggering Works​

TwinCAT triggering is fundamentally different from on-demand reads:

AspectRead Symbol / BlockDevice Notification (Trigger)
ModelRequest-response (pull)Event-driven (push)
ExecutionOne-time read per callContinuous streaming on each PLC push
LifecycleStatelessStateful ADS device-notification subscription
Use CaseOn-demand data accessReal-time change detection, telemetry

When you configure a TwinCAT Trigger:

  1. MaestroHub registers an ADS device notification on the symbol named by the Device Notification function, using its mode (on-change / cyclic) and cycle time.
  2. The PLC pushes a sample whenever the value changes (on-change) or every cycle (cyclic).
  3. Each sample is decoded according to the symbol's data type and one trigger event is emitted.
  4. The pipeline executes with the sample available as $trigger.
Baseline value on subscribe

When a subscription registers, the PLC's first (baseline) push can arrive before the connector has finished recording the subscription. The connector buffers and replays that baseline sample rather than dropping it, so the first pipeline execution sees the initial value.


Reconnection Handling​

MaestroHub automatically handles transport disruptions to ensure reliable monitoring.

Automatic Recovery​

When the TwinCAT connection is lost and restored:

  1. Connection Lost: The system detects the disconnection (transport error or failed health probe) and tears the session down.
  2. Connection Restored: A fresh ADS session is opened. Because notification handles are per-session, the connector re-registers all active subscriptions on the new session.
  3. Transparent Recovery: Pipelines continue to receive samples once the connection is restored — no manual intervention required.

What This Means for Your Workflows​

ScenarioBehavior
Transient network errorAutomatic resubscription after reconnection
PLC program downloadThe symbol table is re-uploaded and handles are re-resolved on the next session
PLC restart / power-cycleSubscriptions are re-registered once the runtime is reachable again
MaestroHub restartAll triggers for enabled pipelines are restored on startup
Minimising data loss

Samples the PLC pushes while the connector is disconnected are lost — ADS has no replay buffer the client can rewind. For critical signals, complement the trigger with a periodic Read node driven by a Schedule trigger so a polled value lands even if a push is missed.


Configuration Options​

Basic Information​

FieldTypeDescription
Node LabelString (Required)Display name for the node on the pipeline canvas. Must be non-empty (trimmed).
DescriptionString (Optional)Explains what this trigger initiates.

Configuration​

The trigger configuration is organized across three tabs in the UI: Configuration, Test Data, and Basic.

ParameterTypeDefaultRequiredDescription
ConnectionConnection ID""YesThe TwinCAT connection profile to subscribe through. Filtered to TwinCAT connections only.
Device Notification FunctionFunction ID""YesThe function that defines the subscription (symbol, mode, cycle time). Filtered to twincat.notify function types on the selected connection.
EnabledBooleantrueNoWhen disabled, the subscription is not created even if the pipeline is enabled.
Function Requirement

The selected function must be a Device Notification function type (twincat.notify). Read Symbol, Read Block, Read Struct, Write Symbol, and Write Struct functions cannot be used with TwinCAT Trigger nodes.

If the selected connection has no Device Notification functions yet, the node configuration panel surfaces a link straight to the connection's Functions tab so you can author one.

Device Notification Function Configuration​

The selected function (authored in the Connect module) controls what gets monitored and how often:

SettingDescription
Symbol / TagThe PLC symbol path to monitor (or a tag-map alias).
ModeonChange (push only when the value changes) or cyclic (push every cycle time).
Cycle Time (ms)The sampling cycle for cyclic mode, and the server's change-check interval for on-change. 0 = server default.
Max Delay (ms)Maximum time the server batches samples before pushing. 0 = no batching (push immediately).
Data TypeOptional override for decoding each sample; blank uses the symbol table type.

See Device Notification for the full function reference.

Test Data​

The Test Data tab holds a Sample Payload editor and a Sample Quality picker. When you run the node with Test Node in Sandbox mode, the trigger emits the sample payload as result instead of waiting for a real notification, so you can validate downstream nodes before a PLC is wired up. When the editor is empty, a built-in sample is used. Sample Quality sets the quality the sample reports in $trigger._metadata.quality (good, uncertain or bad). The live subscription and the node's Fire Trigger action do not use the sample.

{
"value": 23.5,
"symbol": "MAIN.fTemperature"
}

Settings​

Description

A free-text area for documenting the node's purpose and behavior. Notes entered here are saved with the pipeline and visible to all team members.

Execution Settings

SettingOptionsDefaultDescription
On ErrorPipeline Default / Stop Pipeline / Continue ExecutionPipeline DefaultBehavior when the node fails.

Output Data Structure​

When an ADS device notification arrives and triggers pipeline execution, the trigger produces a structured output with two top-level keys: _metadata and result. One event is emitted per delivered sample.

Output Format​

{
"_metadata": {
"type": "twincat_trigger",
"protocol": "twincat",
"connectionId": "bf29be94-fc0a-4dc4-8e5c-092f1b74eb4b",
"functionId": "aef374c3-aa2b-454e-aabc-5657faac5950",
"symbol": "MAIN.fTemperature",
"dataType": "LREAL",
"timestamp": "2026-05-20T10:30:45.123456789Z"
},
"result": {
"symbol": "MAIN.fTemperature",
"value": 23.5,
"dataType": "LREAL",
"timestamp": "2026-05-20T10:30:45.123456789Z"
}
}

result Fields​

FieldTypeDescription
symbolstringThe monitored PLC symbol path.
valueanyThe decoded sample value — BOOL → boolean, integer types → number, REAL/LREAL → number, STRING/WSTRING → string.
dataTypestringThe data type used to decode the sample.
timestampstringISO 8601 / RFC 3339 (nanoseconds) — the PLC server timestamp for this sample, UTC.

_metadata Fields​

FieldTypeDescription
typestringAlways "twincat_trigger".
protocolstringAlways "twincat".
connectionIdstringThe TwinCAT connection profile ID.
functionIdstringThe Device Notification function ID.
symbolstringThe monitored symbol path.
dataTypestringThe data type used to decode the sample.
timestampstringISO 8601 / RFC 3339 (nanoseconds) — the sample's server timestamp, UTC.
qualitystringgood for every decoded sample. bad on a failure event: once per outage, when a sample cannot be decoded or the ADS connection is lost, the trigger fires with the last decoded payload, quality: "bad" and the cause under error. The next decoded sample is good again. A UNS Publish node downstream inherits the verdict.
quality_reasonstringOnly on a failure event: comm_error. A UNS Publish node downstream forwards it, so the stored sample reads bad · comm_error rather than just bad.
errorstringOnly on a failure event: the decode error or ADS connection lost.

Referencing in Downstream Nodes​

Use expressions to access trigger data in subsequent nodes:

  • $trigger.result.value — the decoded value of the monitored symbol
  • $trigger.result.symbol — the symbol path
  • $trigger.result.dataType — the data type used to decode
  • $trigger.result.timestamp — the PLC server timestamp for the sample
  • $trigger._metadata.connectionId — connection profile used
  • $trigger._metadata.functionId — Device Notification function used

Validation Rules​

Parameter Validation​

Node Label

  • Must not be empty
  • Must not consist only of whitespace
  • Error: "Node name is required"

Connection ID

  • Must be provided and non-empty
  • Must reference a valid TwinCAT connection profile
  • Error: "TwinCAT connection is required"

Function ID

  • Must be provided and non-empty
  • Must reference a valid Device Notification function
  • Function must belong to the specified connection
  • Error: "Device notification function is required"

Enabled Flag

  • Must be a boolean if provided
  • Error: "Enabled must be a boolean value"

Usage Examples​

Real-Time Temperature Monitoring​

Key configuration

  • Label: Furnace Temperature Monitor
  • Connection: TC3 Line 1 PLC
  • Function: Device Notification on MAIN.fTemperature, mode cyclic, cycle time 500 ms
  • Enabled: true
  • Settings: on error stop

Downstream usage: $trigger.result.value for the temperature reading, $trigger.result.timestamp for the sample time. Forward into the Aggregator node to compute a sliding-window average before publishing to MQTT.

Alarm / Flag Monitoring​

Key configuration

  • Label: E-Stop Monitor
  • Connection: TC3 Line 1 PLC
  • Function: Device Notification on GVL.bEStop, mode onChange
  • Enabled: true
  • Settings: on error continue

Downstream usage: $trigger.result.value for the current state. With onChange, the pipeline only fires on actual transitions — perfect for kicking off an alert on each edge without churning on the steady state.

Production Counter Tracking​

Key configuration

  • Label: Part Count Tracker
  • Connection: TC3 Packaging PLC
  • Function: Device Notification on MAIN.nPartCount, mode onChange
  • Enabled: true

Downstream usage: $trigger.result.value for the counter value; compute production rate from consecutive values using $trigger.result.timestamp.


Best Practices​

Subscription Design​

  • Choose onChange for slow-changing signals (door state, mode flag, alarm) so steady-state churn does not waste pipeline executions. Use cyclic when you need a sample on a fixed interval regardless of change.
  • Tune the Cycle Time to the fastest rate you actually need. For on-change it is the server's change-check interval; a smaller value detects changes sooner but checks more often.
  • Use Max Delay to let the server batch bursts of samples when sub-millisecond latency is not required.

Designing for Reliability​

PracticeRationale
Add a polled Read fallback for critical signalsSamples pushed during a disconnection are lost — a periodic Schedule-driven Read backstops the live trigger
Keep the subscribed symbol count reasonable per connectionEach subscription is a server-side notification on the PLC; many high-rate symbols add load
Buffer downstream with an Aggregator for high-rate signalsA slow consumer can cause samples to be dropped under backpressure (a one-time warning is logged)

Error Handling Strategies​

For Critical Workflows:

  • Set On Error to stopPipeline
  • Monitor pipeline execution failures via the Health dashboard
  • Implement alerting for stopped pipelines

For Best-Effort Processing:

  • Set On Error to continueExecution
  • Log failed executions for later analysis
  • Ensure downstream nodes handle partial failures gracefully

Performance Considerations​

ScenarioRecommendation
High-frequency changesUse onChange with a sensible Cycle Time, or set a Max Delay to batch samples; buffer downstream so a slow consumer never stalls processing
Many monitored symbolsSpread subscriptions across connections; running multiple TwinCAT connections distributes the load
Dropped-sample warningsIf you see "dropping notification samples" warnings, the downstream consumer can't keep up — raise the Cycle Time, reduce subscribed symbols, or aggregate downstream

Enable vs. Disable​

  • Use the trigger's Enabled parameter to temporarily pause monitoring without changing pipeline state
  • Disable triggers during maintenance windows to prevent processing stale reconnection data
  • Document the reason for disabled triggers in the node's Description field