Reputation: 3905
I need to subscribe to ~1000 nodes, which were created in a hierarchy, like:
ns=2;s=0:Manufacturing.E01.Ambient.Temperature
ns=2;s=0:Manufacturing.E01.Ambient.WindDir
ns=2;s=0:Manufacturing.E01.Commands.AckAllErrors
ns=2;s=0:Manufacturing.E03.Ambient.Temperature
ns=2;s=0:Manufacturing.E03.Ambient.WindDir
ns=2;s=0:Manufacturing.E03.Ambient.WindSpeed
I am treating every update the same way, thus calling subscription.monitor()
function for each of them and creating a new callback function does not seem to be the optimal way to me.
Is it possible to subscribe to multiple nodes with a pattern, e.g all nodes that fall under:
ns=2;s=0:Manufacturing.E01.
Upvotes: 1
Views: 2269
Reputation: 3256
No it is not - There is no way to subscribe to a "folder" in OPC UA.
The easiest way to proceed in your case will be to first browse the Folders by using the OPC UA Browse Service.
The OPC UA Server will return you all the references from the asked Starting Node (OPC UA Parent-Children references might be Organizes, HasComponent, Has Property,...).
Then you can use the OPC UA CreateSubscription/CreateMonitoredItems Services to subscribe to the Nodes.
Upvotes: 6