Grouped Subscription|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Grouped Subscription
Avatar
EuroEager2008
Member
Members
Forum Posts: 12
Member Since:
11/23/2014
sp_UserOfflineSmall Offline
1
03/27/2021 - 07:20
sp_Permalink sp_Print

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)

Avatar
Randy Armstrong
Admin
Forum Posts: 1579
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
03/27/2021 - 09:55
sp_Permalink sp_Print

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.

Avatar
EuroEager2008
Member
Members
Forum Posts: 12
Member Since:
11/23/2014
sp_UserOfflineSmall Offline
3
03/27/2021 - 17:13
sp_Permalink sp_Print

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)

Avatar
Randy Armstrong
Admin
Forum Posts: 1579
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
03/27/2021 - 22:34
sp_Permalink sp_Print

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.

Avatar
EuroEager2008
Member
Members
Forum Posts: 12
Member Since:
11/23/2014
sp_UserOfflineSmall Offline
5
03/30/2021 - 06:31
sp_Permalink sp_Print

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.

Avatar
Randy Armstrong
Admin
Forum Posts: 1579
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
6
03/30/2021 - 10:21
sp_Permalink sp_Print

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.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online: Sam Weintraub
Guest(s) 19
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1445
Posts: 4889