Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Subscribing to an array variable value
June 26, 2024
10:23, EEST
Avatar
Francesco Zambon
Member
Members
Forum Posts: 83
Member Since:
December 20, 2021
sp_UserOfflineSmall Offline

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.

June 26, 2024
11:01, EEST
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 330
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

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.

June 26, 2024
11:19, EEST
Avatar
Francesco Zambon
Member
Members
Forum Posts: 83
Member Since:
December 20, 2021
sp_UserOfflineSmall Offline

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

June 26, 2024
11:42, EEST
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 330
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
16 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 142

pramanj: 86

Francesco Zambon: 83

rocket science: 82

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 704

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1482

Posts: 6316

Newest Members:

samui, TommyDab, wross, Jeremyknock, Pedromon, DonaldEdism, Miguelplese, Scotanine, katesalas95, Petertum

Moderators: Jouni Aro: 1015, Pyry: 1, Petri: 0, Bjarne Boström: 994, Jimmy Ni: 26, Matti Siponen: 330, Lusetti: 0

Administrators: admin: 1