DataTypeDictionary consistency and lifetime

Unified Architecture topics related to OPC UA Specification, compliant behavior and any technical issues of OPC UA, like Security, Information Model, Companion Specs DI, PLCopen, ADI, ...

Moderator: Support Team

Post Reply
Jr. Member
Jr. Member
Posts: 1
Joined: 18 Jan 2018, 09:18

DataTypeDictionary consistency and lifetime

Post by ralphlange »

On the client side (C++),
I can get the structure definition of an ExtensionObject through calling the DataTypeDictionary that is an interface, i.e. a part of the Session.

Question: is the definition for any given DataTypeId constant over the lifetime of the session? Or can the server change a user defined data structure while keeping the session alive?

Use case: the client is monitoring a large user defined structure, and needs to get out a small number of its elements that it knows by name. Getting the structure definition and searching for the matching elements takes time. Can the client store the indices of the elements it is interested in when doing the first read, and just directly read the elements using the stored indices on all further data updates during the session?

User avatar
Support Team
Hero Member
Hero Member
Posts: 2550
Joined: 18 Mar 2011, 15:09

Re: DataTypeDictionary consistency and lifetime

Post by Support Team »


it is strongly recommended that the server keeps the data structure layout (DataTypes) unchanged (except for dynamic data like arrays or strings).
If a structure data type changes, it is strongly recommended to create a new DataType with a new NodeId.
But a server may miss-behave.

But a change in the structure would most likely cause an decoding error on the client side or creates random invalid data in the resulting structure.

If you refer in your question to the index of the structure field, you can assume the index as stable.
Best regards
Unified Automation Support Team

Post Reply