Acknowledge Alarm

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
rcpat
Full Member
Full Member
Posts: 5
Joined: 23 Jul 2015, 10:15

Acknowledge Alarm

Post 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.

rcpat
Full Member
Full Member
Posts: 5
Joined: 23 Jul 2015, 10:15

Re: Acknowledge Alarm

Post 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.

rcpat
Full Member
Full Member
Posts: 5
Joined: 23 Jul 2015, 10:15

Re: Acknowledge Alarm

Post 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?

User avatar
Support Team
Hero Member
Hero Member
Posts: 2492
Joined: 18 Mar 2011, 15:09

Re: Acknowledge Alarm

Post 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.

aw29erac
Jr. Member
Jr. Member
Posts: 1
Joined: 16 Dec 2015, 17:35

Re: Acknowledge Alarm

Post 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!

User avatar
Support Team
Hero Member
Hero Member
Posts: 2492
Joined: 18 Mar 2011, 15:09

Re: Acknowledge Alarm

Post 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

Post Reply