EventNotifier for specific events

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

Moderator: uasdkcpp

Post Reply
heininmi
Jr. Member
Jr. Member
Posts: 2
Joined: 20 Jun 2013, 12:50

EventNotifier for specific events

Post by heininmi »

Hello,
I'm trying to implement events in a OPC UA Server. It works fine, but I have one question...
If I subscribe to an EventNotifier, I have to filter threw all events the server have.
Is it possible to create a EventNotifier (for example a folder) to which I can subscribe and get only specific events ?
Without to filter?

Thanks and best regards.

heininmi
Jr. Member
Jr. Member
Posts: 2
Joined: 20 Jun 2013, 12:50

Re: EventNotifier for specific events

Post by heininmi »

Don't bother.
I figured it out.

Code: Select all

..   
//Add new UaFolder
ret = addNodeAndReference(pParentFolder, pFolder, OpcUaId_HasComponent);
    
var = new DataVariable("Var", UaNodeId("Var", TC_NAMESPACE), ...);
ret = addNodeAndReference(pFolder, var, OpcUaId_HasComponent);   
..

//Link UaFolder to Var as Notifier
 ret = addUaReference(
     pFolder->nodeId(),
      UaNodeId("Var", TC_NAMESPACE),
      OpcUaId_HasNotifier);

//Register EventNotifier -> hang in NotifierTree
    registerEventNotifier(OpcUaId_Server, pFolder->nodeId());
    registerEventNotifier( pFolder->nodeId(), UaNodeId("Var", TC_NAMESPACE));
 
// Register the event data class with the BaseEventType to allow selection of custom event fields
....

//Link Var to Event
    ret = addUaReference(
      UaNodeId("Var", TC_NAMESPACE),
      UaNodeId("Event", TC_NAMESPACE),
      OpcUaId_GeneratesEvent);
 
That worked.
If I drop the new Folder in the EventView, I get only the Event linked to Var.

Post Reply