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: 88
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: 349
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: 88
Member Since:
March 16, 2017
sp_UserOfflineSmall Offline

Thank you for clarification!

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
47 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: 726

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1529

Posts: 6471

Newest Members:

gabriellabachus, Deakin, KTP25Zof, Wojciech Kubala, efrennowell431, wilfredostuart, caitlynfajardo, jeromechubb7, franciscagrimwad, adult_gallery

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0

Administrators: admin: 1