Page 1 of 1

Acknowledge Alarm

Posted: 27 Jul 2015, 11:56
by rcpat
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.

Re: Acknowledge Alarm

Posted: 28 Jul 2015, 14:51
by rcpat
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.

Re: Acknowledge Alarm

Posted: 29 Jul 2015, 11:14
by rcpat
We've got access to the event's nodeid in the NewEvent call using

Code: Select all

m.Filter.SelectClauses.Add(ObjectTypeIds.ConditionType, (QualifiedName[])null, NodeClass.Object);
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?

Re: Acknowledge Alarm

Posted: 12 Aug 2015, 14:59
by Support Team
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.

Re: Acknowledge Alarm

Posted: 05 Feb 2016, 11:59
by aw29erac
Hey,

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);	
But i'm just able to get the AckedState/Id this way:

Code: Select all

Boolean ackedState1 = myEvent.Event.EventFields[9].ToBoolean();
Because it's the ninth entry in the EventFields array.
But I want to get it, like this:

Code: Select all

LocalizedText ackedState = filter.GetValue<LocalizedText>(myEvent.Event, BrowseNames.AckedState, LocalizedText.Null);
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!

Re: Acknowledge Alarm

Posted: 11 Feb 2016, 11:30
by Support Team
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

Code: Select all


    LocalizedText ackedState = filter.GetValue<LocalizedText>(myEvent.Event, BrowseNames.AckedState, LocalizedText.Null);
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