Please consider registering

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
Subscribe to a node having a complex data type
April 16, 2024
17:44, EEST
rocket science
Forum Posts: 81
Member Since:
March 16, 2017
sp_UserOfflineSmall Offline


assume I have a complex data type like:

+ Name (String)
+ Value (Integer)
+ Toggle (Boolean)

And I subscribe to a node which has such a complex data type as value.

If then one of Name, Value or Toggle changes, I’ll get a onDataChanged notification when one of these values changes, right?

But would it be also possible to subscribe to the node and somehow get only onDataChanged notifications from the subscription when e.g. the Toggle changes?


April 17, 2024
10:49, EEST
Matti Siponen

Forum Posts: 328
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline


In general, OPC UA doesn’t support definining MonitoredItems in a way where they would report data changes only when the Value of a selected Field of a Structure Value changes. If you create a MonitoredItem for a Variable with a Structure Value, it will report data changes whenever any Field or Fields of the Structure Value change.

If the Variable with the Structure Value has “child” Nodes that represent the individual Fields of the Structure Value, then you could make the MonitoredItem for one of those Nodes instead of the “parent” Node with the Structure Value. However, that would mean that you get data change notifications for the Value of only that Field, which is not the same as getting data change notifications for the entire Structure Value when the Value of the selected Field changes. Though, you could use this data change notification to trigger reading the entire Structure Value from the “parent” Node, which could be better if you do not wish to create MonitoredItem for that Node directly to avoid getting data change notifications when Values of other Fields change.

Note, that whether or not the Variable with the Structure Value has “child” Nodes representing Fields of the Structure depends on the VariableType of the Node and sometimes Server implementation. There is no guarantee that all Variables with Structure Values would have “child” Nodes for the Fields of their Structure Values especially if the DataType of the Variable would allow it to have different types of Structure Values.

April 17, 2024
13:05, EEST
rocket science
Forum Posts: 81
Member Since:
March 16, 2017
sp_UserOfflineSmall Offline

Thank you for clarification!

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
26 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 138

pramanj: 86

rocket science: 81

Francesco Zambon: 81

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 713

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1476

Posts: 6294

Newest Members:

mariam6210, donblanchard632, HowardLon, delilahhuggard, salvadorcolby69, HelenImpar, MnoioDat, babuinsobaka, Miikka Mikkonen, rickeylipinski

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

Administrators: admin: 1