Hello,
I'm looking to have the client acknowledge alarms - preferably just after the event has been triggered (Subscription_NewEvents). I haven't been able to find how to do this in the documentation -- pointers would be appreciated.
Acknowledge Alarm
Moderator: uasdknet
-
- Full Member
- Posts: 5
- Joined: 23 Jul 2015, 10:15
Re: Acknowledge Alarm
It seems a call must be made from the client to the "Acknowledge" function via session.Call. The first parameter is the event node ID, the second is the acknowledge method nodeid, with the eventid and comment as an argument.
session.Call(event-node-id , acknowledge-node-id , List<Variant> /*eventid*/ , ...)
However I haven't found how to get the event's node ID yet.
session.Call(event-node-id , acknowledge-node-id , List<Variant> /*eventid*/ , ...)
However I haven't found how to get the event's node ID yet.
-
- Full Member
- Posts: 5
- Joined: 23 Jul 2015, 10:15
Re: Acknowledge Alarm
We've got access to the event's nodeid in the NewEvent call using
However, I can't see a way to access the node ID via BrowseNames lookup - only by indexing the array, which may be unreliable. Is there a way to access the event nodeid (conditionid) via BrowseNames?
Code: Select all
m.Filter.SelectClauses.Add(ObjectTypeIds.ConditionType, (QualifiedName[])null, NodeClass.Object);
- Support Team
- Hero Member
- Posts: 3070
- Joined: 18 Mar 2011, 15:09
Re: Acknowledge Alarm
ObjectId = ConditionId
MethodId = NodeId of the Acknowlegde Method on the _AcknowledgeableConditionType - this is a well known NodeId defined by OPC.
InputArgument[0] = EventId
The ConditionId and the EventId are EventFields the server sends with each EventNotification that's related to the alarm.
In other words - whenever the state of an alarm condition changes the server sends an event to let the client know about this change. This event contains all the information in the event fields (ConditionId, EventId).
Best Regards,
Unified Automation Support Team.
MethodId = NodeId of the Acknowlegde Method on the _AcknowledgeableConditionType - this is a well known NodeId defined by OPC.
InputArgument[0] = EventId
The ConditionId and the EventId are EventFields the server sends with each EventNotification that's related to the alarm.
In other words - whenever the state of an alarm condition changes the server sends an event to let the client know about this change. This event contains all the information in the event fields (ConditionId, EventId).
Best Regards,
Unified Automation Support Team.
-
- Jr. Member
- Posts: 1
- Joined: 16 Dec 2015, 17:35
Re: Acknowledge Alarm
Hey,
how can i get the AckedState/Id and the ConfirmedState/Id?
I tried:
But i'm just able to get the AckedState/Id this way:
Because it's the ninth entry in the EventFields array.
But I want to get it, like this:
The ConfirmedState/Id is "null" in the Event Fields array.
I would also appreciate if your firm could make an Tutorial for Events.
That would be very nice!
Thanks!
how can i get the AckedState/Id and the ConfirmedState/Id?
I tried:
Code: Select all
// AckedState/Id
QualifiedName[] ackedStateNames = new QualifiedName[2];
ackedStateNames[0] = new QualifiedName(UnifiedAutomation.UaBase.BrowseNames.AckedState);
ackedStateNames[1] = new QualifiedName(UnifiedAutomation.UaBase.BrowseNames.Id);
monitoredItem.Filter.SelectClauses.Add(UnifiedAutomation.UaBase.ObjectTypeIds.ConditionType, ackedStateNames);
// ConfirmedState/Id
QualifiedName[] confirmedStateNames = new QualifiedName[2];
confirmedStateNames[0] = new QualifiedName(UnifiedAutomation.UaBase.BrowseNames.ConfirmedState);
confirmedStateNames[1] = new QualifiedName(UnifiedAutomation.UaBase.BrowseNames.Id);
monitoredItem.Filter.SelectClauses.Add(UnifiedAutomation.UaBase.ObjectTypeIds.ConditionType, confirmedStateNames);
Code: Select all
Boolean ackedState1 = myEvent.Event.EventFields[9].ToBoolean();
But I want to get it, like this:
Code: Select all
LocalizedText ackedState = filter.GetValue<LocalizedText>(myEvent.Event, BrowseNames.AckedState, LocalizedText.Null);
I would also appreciate if your firm could make an Tutorial for Events.
That would be very nice!
Thanks!
- Support Team
- Hero Member
- Posts: 3070
- Joined: 18 Mar 2011, 15:09
Re: Acknowledge Alarm
Hello,
There are two problems.
1. You select AckedState/Id (DataType bool) and want to get the value of AckedState (DataType LocalizedText). If you select the AckedState EventField in addition, the call of
will work.
2. ConfirmedState and is optional. It seems that the server does not support the ConfirmedState EventField.
In the DemoServer application there is an example for an Alarm supporting the ConfirmedState. Please see method SetupBoiler in the file DEmoNodeManager.Boiler.cs.
Best regards
Support Team
There are two problems.
1. You select AckedState/Id (DataType bool) and want to get the value of AckedState (DataType LocalizedText). If you select the AckedState EventField in addition, the call of
Code: Select all
LocalizedText ackedState = filter.GetValue<LocalizedText>(myEvent.Event, BrowseNames.AckedState, LocalizedText.Null);
2. ConfirmedState and is optional. It seems that the server does not support the ConfirmedState EventField.
In the DemoServer application there is an example for an Alarm supporting the ConfirmedState. Please see method SetupBoiler in the file DEmoNodeManager.Boiler.cs.
Best regards
Support Team