

10:23, EEST

December 20, 2021

Good morning,
I have a question about how subscriptions work for variables containing an array:
If I create a subscription from the OPC UA Prosys SDK client to receive the value of a variable of array type,
would it be possible to receive an update for a single element of the array that has changed,
or do I always receive the entire array and then have to manually check for differences?
Best regards,
Thank you.
11:01, EEST

Moderators
February 11, 2020

Hello,
You can use the setIndexRange method of Client MonitoredDataItem to select which part of the array you wish to receive in DataChangeNotifications. If you wish to receive single index x from a one-dimensional array, you would use new NumericRange(x) as the IndexRange for the MonitoredDataItem. See https://reference.opcfoundation.org/Core/Part4/v105/docs/7.27 for more information on the NumericRange format.
11:19, EEST

December 20, 2021

Dear Matti,
Thank you very much for your response.
About “setIndexRange method”:
This feature can be very useful for filtering the reception of updates during the subscription creation phase.
Also I would like to ask for confirmation regarding the OPC UA / Prosys SDK protocol:
If the client listens to the entire array and a single element of the array changes on the server side,
is it correct that the client receives an update for the entire array?
Best regards,
Francesco
11:42, EEST

Moderators
February 11, 2020

Hello,
If the Client hasn’t specified an IndexRange for a MonitoredItem for a Variable with array value, then any change in the array on the Server side should trigger the entire array being sent to the Client as a DataChange Notification via that MonitoredItem. This is how MonitoredItems should work according to the OPC UA Specification.
Most Users Ever Online: 1919
Currently Online:
135 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 793
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1538
Posts: 6493
Newest Members:
sophiadavis, Waynegalse, Phillipbus, Oscarsat, WilliamJer, WilliamTunse, mvsjonah79, RaymondSmutt, Merlin AI pap, patlawrence98Moderators: Jouni Aro: 1027, Pyry: 1, Petri: 0, Bjarne Boström: 1037, Jimmy Ni: 26, Matti Siponen: 353, Lusetti: 0
Administrators: admin: 1