Handle RefreshRequiredEventType from OtOpcUa (trigger ConditionRefresh) #148
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
OtOpcUa (lmxopcua gRPC data connections A3/A4) now emits
RefreshRequiredEventTypefor the first time — on an incomplete condition snapshot, a removed imported condition, or after a resync that invalidates EventIds (a pre-failover EventId then answers BadEventIdUnknown).ScadaBridge's event handling (
RealOpcUaClient.cs:1211-1240) has no RefreshRequired branch: the event falls through as a 'condition' keyedServer, and no ConditionRefresh is issued, so ScadaBridge can hold stale alarm state / un-ackable EventIds. Per OPC UA Part 9, on RefreshRequired the client should call ConditionRefresh (or ConditionRefresh2 for the monitored item) and not treat the event as an alarm.Needed before OtOpcUa's alarm-forwarding (A4) is fleet-deployed.
Fixed in
a117f79a(main @d4d5be3b). ARefreshRequiredEventTypeevent is no longer mapped as an alarm. It now triggers a ConditionRefresh. The refresh runs on a background loop, waits 500 ms so a burst of events causes one refresh, never runs two refreshes at once, and logs failures instead of throwing. It usesConditionRefresh2for each item that asked, and falls back to a subscription-wideConditionRefreshwhen that isn't possible. The refresh replay goes through the existing RefreshStart/RefreshEnd snapshot swap, so conditions the new snapshot no longer lists are cleared. The per-item event filter now always lets RefreshRequired through, so a condition-type filter can't drop it on the server side. Unit-tested only: not yet checked against a live OtOpcUa A3/A4 node.