11/23/2014
OPCDA (classic) data subscription model was/is based on group descriptions where the callback included all items added for subscription.
Does OPCUA offer something similar?
It is easy to understand the rationale of subscribing for data via MonitoredItems which may notify by separate event notifocation (one for each item).
It sounds like not the best thing to do performance-wise, but my concern is more that I need to consistently (and orderly) send all the values further on in whole “packages” (NMEA) and a group subscription would make this simple.
If performance does not suffer from Session.ReadValues() that would be fine for my purpose.
Or is it another way to do this ? (I am quite new to OPCUA)
05/30/2017
OPCUA removed the “refresh” and group read capabilities because they encouraged people to write inefficient client code. There are very few applications where constantly polling data can be justified (i.e. the need to meet regulatory requirements).
If an application really has a good reason to poll all data then the RegisterNode Service should be used to create optimized handles:
https://reference.opcfoundatio…..rt4/5.8.5/
The Read Service can be called with these handles instead of the NodeIds.
11/23/2014
Thanks a lot for your hint regarding node registration, I am sure that’s more efficient (due to numeric NodeId’s?).
I tried, but got exception BadSessionInvalid, but I am not sure how to call RegisterNodes properly.
(I tried to construct a SessionClient(<mySessionJustUsedForBrowsing>.TransportChannel) and calling RegsisterNodes on it)
However, I am not sure if I understood your reply correctly.
Did you actually confirm that it is not possible to subscribe for groupdata such that only one event is generated containing all the data of the group (and thus, if I need a consistent dataset I have to use the Read service in some manner, i.e. polling)
05/30/2017
It is not clear what you are expecting. Clients create a subscription and can add many monitored items. If the underlying data is constantly changing then Clients will get a single message with all of the values in the subscription.
If the data is not constantly changing then clients will only get the values that actually changed.
It is also not clear what you mean by “consistent”. Even in OPCDA you could not get a “consistent” dataset with a group read because there is no guarantee that the individual items were read at the same time.
11/23/2014
Thanks again Randy
Sure, I do realize now that consistent data is actually not guaranteed whichever method is used, i.e. subscription could be the best candidate.
However, my client’s requirements dictates reading all values, changed or not and I assume ReadValues is my only option.
I have tried and it works seemingly fine, however, the owner of the server has asked me to take care of performance and resources and thus I tried via RegisterNodes, but it fails as described earlier.
I have searched for examples using this service correctly, but found zero, if you got some links regarding this, please reply with them.
05/30/2017
You need to call Read within the context of the same Session that you called RegisterNodes on.
If you create a Session for browsing and call RegisterNodes then those NodeIds can only be used within browsing Session.
I would also suggest that investigate why your client wants “all values read”. Is it based on a real need or is it based on a misunderstanding of the technology available? If it is based on a read need then it is possible that locally cached list updated via a subscription that is reporting keep -alives and other failure detection mechanisms would actually meet the requirement.
The failure detection mechanisms are a key improvement of OPC UA which may make OPC UA subscriptions acceptable when OPCDA subscriptions were not.
1 Guest(s)