![sp_Feed](https://forum.prosysopc.com/wp-content/sp-resources/forum-themes/default/images/sp_Feed.png)
![sp_TopicIcon](https://forum.prosysopc.com/wp-content/sp-resources/forum-themes/default/images/sp_TopicIcon.png)
10:23, EEST
![Avatar](https://forum.prosysopc.com/wp-content/sp-resources/forum-avatars/defaults/userdefault.png)
December 20, 2021
![sp_UserOfflineSmall](https://forum.prosysopc.com/wp-content/sp-resources/forum-themes/default/images/sp_UserOfflineSmall.png)
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
![Avatar](https://forum.prosysopc.com/wp-content/sp-resources/forum-avatars/defaults/moderatordefault.png)
Moderators
February 11, 2020
![sp_UserOfflineSmall](https://forum.prosysopc.com/wp-content/sp-resources/forum-themes/default/images/sp_UserOfflineSmall.png)
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
![Avatar](https://forum.prosysopc.com/wp-content/sp-resources/forum-avatars/defaults/userdefault.png)
December 20, 2021
![sp_UserOfflineSmall](https://forum.prosysopc.com/wp-content/sp-resources/forum-themes/default/images/sp_UserOfflineSmall.png)
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
![Avatar](https://forum.prosysopc.com/wp-content/sp-resources/forum-avatars/defaults/moderatordefault.png)
Moderators
February 11, 2020
![sp_UserOfflineSmall](https://forum.prosysopc.com/wp-content/sp-resources/forum-themes/default/images/sp_UserOfflineSmall.png)
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: 518
Currently Online:
14 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 142
pramanj: 86
rocket science: 85
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 724
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1495
Posts: 6352
Newest Members:
armandovarley, dole, rustyhammer, braydenaquino6, blaircleveland0, maribelkeeler7, Nicky, rickymeade2, niamhtoussaint0, adamq0505309Moderators: Jouni Aro: 1017, Pyry: 1, Petri: 0, Bjarne Boström: 1003, Jimmy Ni: 26, Matti Siponen: 337, Lusetti: 0
Administrators: admin: 1