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.
EventNotifier for specific events
Moderator: uasdkcpp
-
- Jr. Member
- Posts: 2
- Joined: 20 Jun 2013, 12:50
Re: EventNotifier for specific events
Don't bother.
I figured it out.
That worked.
If I drop the new Folder in the EventView, I get only the Event linked to Var.
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);
If I drop the new Folder in the EventView, I get only the Event linked to Var.