Dynamic Type Model|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Dynamic Type Model
Avatar
2M
Member
Members
Forum Posts: 5
Member Since:
07/16/2019
sp_UserOfflineSmall Offline
1
03/29/2022 - 06:16
sp_Permalink sp_Print

Does the standard say anything about dynamic type models? In other words, is it allowed to alter the types hierarchy during the runtime of the server while sessions are in place?

The use case for this is an aggregating server where its type hierarchy depends on the underlaying servers. The type hierarchy of the aggregating server could change during runtime when it is connected to new underlaying servers with some custom types or when it gets disconnected from some servers.

If this is mentioned in the standard, I would appreciate a pointer to it.

Avatar
Randy Armstrong
Admin
Forum Posts: 1451
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
03/29/2022 - 06:37
sp_Permalink sp_Print

Adding types while is server is running is no problem.

Deleting types can be problematic but it is not explicitly prohibited for leaf types.

Modifying types or deleting supertypes changes the type contract which is a breaking change and not allowed.

You also should never re-use a NodeId if a type is deleted and re-added.

Avatar
2M
Member
Members
Forum Posts: 5
Member Since:
07/16/2019
sp_UserOfflineSmall Offline
3
03/30/2022 - 06:06
sp_Permalink sp_Print

Thanks for the clarifications.

Does "modifying types" include changes to the references? Or merely changes to the attributes?

Also, regarding your final note "never re-use a NodeId if a type is deleted and re-added", does it apply as well across sessions?

Avatar
Randy Armstrong
Admin
Forum Posts: 1451
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
03/30/2022 - 09:52
sp_Permalink sp_Print

Clients may cache NodeIds (particularly type NodeIds) between sessions. If you re-use NodeIds clients will be accessing a different NodeId when they reconnect and may not realize it. This could lead to some unexpected behaviour and very hard to find bugs.

So re-using NodeIds should be avoided but not prohibited. In some cases, NodeIds come from an underlying system so the UA server has no control over what the underlying system does.

A type is a API defined by the hierarchy of nodes under the type. Adding or removing mandatory components in the hierarchy or changing the node class, type definition, datatype or method argument of any components would break the API contract. It is allowed if done when all Sessions are closed but should be avoided since clients can be configured with the results a previous session where they browsed the tree and cached the results.

That said, it is not prohibited because the UA server could be building a type tree from an underlying system and the UA server has no control over that system nor any knowledge changes to that system over time (i.e. the type may have changed but the UA server can't know that it did).

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 15
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1354
Posts: 4583