Skip to main content

Triggering Links — Triggering Linked Reporting

Overview​

OPC UA Part 4 §5.12.5 SetTriggering makes one MonitoredItem the trigger; when it fires, a set of linked MI is reported in a burst. Typical scenarios:

  • trigger MI = Threshold Monitoring (e.g. Temp > 80°C, Reporting / mode Disabled )
  • linked MI = A set of high-frequency events that are not reported Sampling by default MI; collect evidence for all of them when a fire occurs.

Functions similarly to a PLC's "fault logging"—it does not record data under normal conditions, but outputs window data when triggered.

Currently not active

The API exists, but requests are not sent to the server—each link call always returns the same value BadNotSupported; see "Current Behavior" below for details.

API​

MethodsCategoryReading and WritingNote
sub.AddTriggeringLinks(triggerMi, linkedMis)MethodsWriteAdd a link, return the value for each link StatusCode
sub.RemoveTriggeringLinks(triggerMi, linkedMis)MethodsWriteRemove Link
public static IReadOnlyList<StatusCode> AddTriggeringLinks(
this OpcUaSubscription sub, uint triggerMonitoredItemId, IEnumerable<uint> linkedMonitoredItemIds);

public static IReadOnlyList<StatusCode> RemoveTriggeringLinks(
this OpcUaSubscription sub, uint triggerMonitoredItemId, IEnumerable<uint> linkedMonitoredItemIds);

(Extension method, in the DarraOpcUa_Client namespace.)

Code Example​

using DarraOpcUa_Client;

using var ua = new DarraOpcUa("opc.tcp://localhost:4840");
ua.Connect();

using var sub = ua.CreateSubscription(100);

// 1) Threshold Monitoring (trigger), Reporting Mode
uint trigMi = sub.Add("ns=2;s=Temp.High", AttributeId.Value, samplingIntervalMs: 200);

// 2) A set of high-frequency signals (linked), Sampling mode — Not normally reported
uint mi1 = sub.Add("ns=2;s=Vibration.X", AttributeId.Value, 50,
MonitoringMode.Sampling, 10, true, null);
uint mi2 = sub.Add("ns=2;s=Vibration.Y", AttributeId.Value, 50,
MonitoringMode.Sampling, 10, true, null);
uint mi3 = sub.Add("ns=2;s=Vibration.Z", AttributeId.Value, 50,
MonitoringMode.Sampling, 10, true, null);

// 3) Set up integration — When triggered Temp.High , send a Vibration.X/Y/Z burst report
var addRes = sub.AddTriggeringLinks(trigMi, new uint[] { mi1, mi2, mi3 });
for (int i = 0; i < addRes.Count; i++)
Console.WriteLine($"link[{i}] = {addRes[i]}");

sub.DataChanged += (s, e) =>
{
Console.WriteLine($"[mi={e.MonitoredItemHandle}] {e.ValueString}");
};

// 4) Disable the linkage
sub.RemoveTriggeringLinks(trigMi, new uint[] { mi3 });

Current Behavior (Important)​

The integration is

AddTriggeringLinks currently inactive / RemoveTriggeringLinks The association will not be sent to the server:

  • In the returned list, Each one is StatusCode.BadNotSupported
  • Post a message Diagnostic Category: Warn Event, Description: Triggering is unavailable
  • No requests SetTriggering will be sent, and the server will not report this information.

So "fault recording" isn't possible right now — linked MI If it's set to Sampling, it really won't push the data; I'll just have to collect the data myself in the callback DataChanged.

Interaction with MonitoringMode (Standardized behavior; currently not in effect)​

Expected Behavior of Part 4 §:5.12.5

trigger Modelinked ModeBehavior
ReportingSamplingWhen the trigger fires, a linked burst is reported (typical)
ReportingDisabledlinked: Reports are not submitted at all; even if triggered, they are not retroactively submitted.
SamplingSamplingIf none are reported, it is invalid SetTriggering.

Best Practices​

  • Don't rely on trigger-based interactions at this stage. — If the linkage doesn't work, and linked is MI set to Sampling true, it really won't push anything. To "collect evidence from the time window before and after the failure," you'll need to maintain a circular buffer yourself in the callback DataChanged.
  • Configure per the rules once the triggering link is live: "trigger" uses a threshold + Reporting; "linked" uses a high-frequency signal + Sampling
  • "trigger" and "linked" must be in the same subscription. — Does not apply across subscriptions
  • link: Use it proactively RemoveTriggeringLinks — Not dependent on GC
  • Check the returned StatusCode — Each link is returned separately; if the trigger does not exist MI or has been deleted, the server will return BadMonitoredItemIdInvalid

Cross-Language Comparison​

C#PythonJavaC++RustC
AddTriggeringLinksadd_triggering_linksaddTriggeringLinksAddTriggeringLinksadd_triggering_linksDarraUa_Subscription_AddTriggeringLinks
RemoveTriggeringLinksremove_triggering_linksremoveTriggeringLinksRemoveTriggeringLinksremove_triggering_linksDarraUa_Subscription_RemoveTriggeringLinks

Next Step​