@@ -86,6 +86,17 @@ public static class OtOpcUaTelemetry
|
||||
Meter.CreateCounter<long>("otopcua.driver.opcuaclient.events", unit: "{event}",
|
||||
description: "OPC UA Client driver session/publish events (event=publish_response|notification|data_change|bad_status_value|publish_error|keepalive_miss|keepalive_recovered|stale_notification_dropped).");
|
||||
|
||||
/// <summary>
|
||||
/// Controller alarms a native-alarm driver saw that NO configured alarm selector on that device claims, so no
|
||||
/// Part 9 condition shows them (lmxopcua#839 — Heidenhain <c>ALARM:</c> selectors without <c>*</c>/<c>OTHER</c>).
|
||||
/// Counted once per alarm occurrence (an alarm entering the unclaimed set), not once per poll. Tagged
|
||||
/// <see cref="PollOverrunDriverTypeTag"/> + <see cref="PollOverrunDriverInstanceTag"/>. A non-zero rate means
|
||||
/// operators are not seeing some controller alarms — add a selector (or an <c>OTHER</c> catch-all).
|
||||
/// </summary>
|
||||
public static readonly Counter<long> DriverAlarmsUnmatched =
|
||||
Meter.CreateCounter<long>("otopcua.driver.alarms.unmatched", unit: "{alarm}",
|
||||
description: "Controller alarm occurrences no configured native-alarm selector claims (shown by no condition).");
|
||||
|
||||
// ---------------- VirtualTag / ScriptedAlarm engines ----------------
|
||||
|
||||
public static readonly Counter<long> VirtualTagEval =
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using ZB.MOM.WW.OtOpcUa.Core.Abstractions;
|
||||
|
||||
namespace ZB.MOM.WW.OtOpcUa.Commons.OpcUa;
|
||||
|
||||
/// <summary>
|
||||
@@ -30,6 +32,11 @@ namespace ZB.MOM.WW.OtOpcUa.Commons.OpcUa;
|
||||
/// time instead of the SDK's ~24.8-day ceiling. A timed snapshot without it (a caller that
|
||||
/// predates the field) falls back to that ceiling — the engine still owns the expiry either way.
|
||||
/// </param>
|
||||
/// <param name="ConditionClass">
|
||||
/// The Part 9 <c>ConditionClass</c> a native source assigned (lmxopcua#839), or <c>null</c> to leave the node's class
|
||||
/// as it is (scripted alarms and every native source that does not classify). Not part of the event delta-gate: a
|
||||
/// class rides along with the transition that set it.
|
||||
/// </param>
|
||||
public sealed record AlarmConditionSnapshot(
|
||||
bool Active,
|
||||
bool Acknowledged,
|
||||
@@ -39,7 +46,8 @@ public sealed record AlarmConditionSnapshot(
|
||||
ushort Severity,
|
||||
string Message,
|
||||
uint StatusCode = OpcUaStatus.Good,
|
||||
DateTime? UnshelveAtUtc = null);
|
||||
DateTime? UnshelveAtUtc = null,
|
||||
AlarmConditionClass? ConditionClass = null);
|
||||
|
||||
/// <summary>
|
||||
/// Commons-local mirror of the Core <c>ShelvingKind</c> enum so this assembly carries no
|
||||
|
||||
@@ -122,6 +122,13 @@ public sealed record AlarmAcknowledgeRequest(
|
||||
/// that writes nothing and a host retaining it Active gets a real "Cleared". <c>false</c> (the default, every source that does not
|
||||
/// opt in) keeps every transition's row.
|
||||
/// </param>
|
||||
/// <param name="ConditionClass">
|
||||
/// Optional Part 9 <c>ConditionClass</c> of the condition (lmxopcua#839), for a source whose upstream classifies its
|
||||
/// alarms in a way that maps onto the Part 9 classes with evidence (Heidenhain's error class / group). When set, the
|
||||
/// host writes it to the condition's <c>ConditionClassId</c> / <c>ConditionClassName</c>; <c>null</c> (every other
|
||||
/// source) leaves the node's class untouched — <c>BaseConditionClass</c> ("not modelled") unless an earlier event of
|
||||
/// the same condition set one. A pure annotation: it never moves Active/Acked state and never fires an event on its own.
|
||||
/// </param>
|
||||
public sealed record AlarmEventArgs(
|
||||
IAlarmSubscriptionHandle SubscriptionHandle,
|
||||
string SourceNodeId,
|
||||
@@ -136,7 +143,8 @@ public sealed record AlarmEventArgs(
|
||||
AlarmTransitionKind Kind = AlarmTransitionKind.Unspecified,
|
||||
int? OpcUaSeverity = null,
|
||||
uint? QualityStatusCode = null,
|
||||
bool IsRestatement = false)
|
||||
bool IsRestatement = false,
|
||||
AlarmConditionClass? ConditionClass = null)
|
||||
{
|
||||
/// <summary>
|
||||
/// True when this event only re-annotates the condition's source-data quality — a
|
||||
@@ -163,3 +171,26 @@ public enum AlarmSeverity { Low, Medium, High, Critical }
|
||||
/// Members are append-only: their numeric values must not move.
|
||||
/// </summary>
|
||||
public enum AlarmTransitionKind { Unspecified = 0, Raise, Acknowledge, Clear, Retrigger, ActiveAcknowledged, InactiveUnacknowledged }
|
||||
|
||||
/// <summary>
|
||||
/// The OPC UA Part 9 condition classes (<c>BaseConditionClassType</c> subtypes, Part 9 §5.9) a driver can assign to a
|
||||
/// native condition via <see cref="AlarmEventArgs.ConditionClass"/> (lmxopcua#839). Only the classes a driver has
|
||||
/// evidence for are listed; <see cref="Base"/> is Part 9's "no class modelled". Members are append-only.
|
||||
/// </summary>
|
||||
public enum AlarmConditionClass
|
||||
{
|
||||
/// <summary><c>BaseConditionClassType</c> — the class is not modelled / not known.</summary>
|
||||
Base = 0,
|
||||
|
||||
/// <summary><c>ProcessConditionClassType</c> — the condition relates to the process the system controls.</summary>
|
||||
Process,
|
||||
|
||||
/// <summary><c>MaintenanceConditionClassType</c> — the condition relates to maintenance.</summary>
|
||||
Maintenance,
|
||||
|
||||
/// <summary><c>SystemConditionClassType</c> — the condition relates to the system itself (hardware, software, comms).</summary>
|
||||
System,
|
||||
|
||||
/// <summary><c>SafetyConditionClassType</c> — the condition relates to safety.</summary>
|
||||
Safety,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user