Open startemplar opened 7 years ago
Yes, you can definitely have multiple monitored items in a single subscription.
It is upto the UA server to make sure that the published value is always the latest, but my understanding is that UA spec guarantees that Client receives the notifications in the same order as sent from the UA Server.
ad.2) the client should check timestamps and based on that decide what is newer. (@jayantad this is more about protocol used, not OPC, besides OPC when asked can send a batch of data, so order of sending/receiving would not help client to sort them out). And just for record please note there are two kinds of timestamps, server ones and source ones.
Thanks, @jayantad and @astrowalker , I found Session.ReadValues method can accept a list of variableIds. Also from OPC UA spec, it supports pub/sub (which is monitoredItem approach), and request/response style of retrieving values (maybe Session.ReadValues method is this style). Currently no sample code using this method, trying to experiment if it meets the need.
I found Subscription class has 1 event handler FastDataChangeNotificationEventHandler that seems to match my goal. Suppose the following scenario, a device may expose several parameters. In OPC UA, it would be represented as a device node with some child nodes (maybe even nodes under child nodes). I think my option is create 1 subscription for the device, add all the childe nodes I want to monitor as monitored items to this subscription, and in 1 callback, I can get all changed node values. It is a hidden gem in OPC UA .NET :-). Of course, I now have another question about how to extend OPC UA client configuration file to say for this device I have these sets of nodes to monitor, that device another sets of nodes to monitor. Think I have to look into source code (have not find documentation yet).
I am still reading documentation but would like to quickly check: