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

Hi,

assume I have a complex data type like:

ComplexDataType
+ 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?

Thanks!

April 17, 2024
10:49, EEST
Avatar
Matti Siponen
Moderator
Members

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

Hello,

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
Avatar
rocket science
Member
Members
Forum Posts: 77
Member Since:
March 16, 2017
sp_UserOfflineSmall Offline

Thank you for clarification!

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
27 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 683

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

digitechroshni, LouieWreve, Kickbiche, karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1