Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event Subscription Problem #10

Open
atheosangel opened this issue Oct 11, 2023 · 1 comment
Open

Event Subscription Problem #10

atheosangel opened this issue Oct 11, 2023 · 1 comment

Comments

@atheosangel
Copy link

Hello,

it's not possible for me to subscribe Events with the Version 2.30-2.33.(look at #9 )
When i downgrade to 2.29 i get the Events without using an filter.

OpcNodeInfo node = Path2NodeID(parentnode, "DeviceSet/IMM_ENGEL_247005");
fclient.SubscribeEvent(node.NodeId, HandleEvent);

When i try to filter the Events, i get nothing.

OpcNodeId[] eventFilterIds = new OpcNodeId[] {
                       Path2NodeID(fclient.BrowseNode(OpcObjectTypes.EventTypesFolder), "BaseEventType/CycleParametersEventType").NodeId,
                       Path2NodeID(fclient.BrowseNode(OpcObjectTypes.EventTypesFolder), "BaseEventType/CycleParametersEventType/EngelCycleParametersEventType").NodeId,
                       Path2NodeID(fclient.BrowseNode(OpcObjectTypes.EventTypesFolder), "BaseEventType/LogbookEventType").NodeId,
                       Path2NodeID(fclient.BrowseNode(OpcObjectTypes.EventTypesFolder), "BaseEventType/LogbookEventType/ProductionStatusChangeLogType").NodeId

                   };
      
var eventFilter = OpcFilter.Using(fclient).FromEvents(eventFilterIds).Select();
subscription = fclient.SubscribeEvent(OpcObjectTypes.ObjectsFolder, eventFilter, HandleEvent);

I want to get the Event EngelCycleParametersEventType. How do i have to set the filter?

grafik

thanks in advanced
atheos

@kpreisser
Copy link
Member

Hi @atheosangel,
thanks for creating this issue.

Can you show us the code of the Path2NodID method, does it call OpcClient.TranslatePath to translate the browse path into a node id? What NodeIDs do you get in the eventFilterIds array?

Additionally, from you code we can see that in the first sample, you are creating the subscription on the "DeviceSet/IMM_ENGEL_247005" node; however in the second sample, you are creating the subscription on the Objects folder. Was this intentional?
If not, please try to also use the Node ID of the "DeviceSet/IMM_ENGEL_247005" node here, as the "Objects" folder probably doesn't have a HasNotifier reference. Alternatively, it would be the "Server" object (OpcObjectTypes.Server) that may also raise events, depending on the server.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants