Clarification on handling EnumStrings/EnumValues in enumeration Variable Instances|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
Clarification on handling EnumStrings/EnumValues in enumeration Variable Instances
Avatar
Martin Lang
Germany
Member
Members
Forum Posts: 75
Member Since:
06/25/2014
sp_UserOfflineSmall Offline
1
04/24/2025 - 02:05
sp_Permalink sp_Print

We are currently discussing how to implement variables as instances of the data type Enumeration and how to handle associated properties like EnumStringsor EnumValues. According to the specification, the EnumStrings property must be modeled as a child node of the Enumeration DataType. However, it is unclear whether it is permitted to add EnumStrings to a variable instance that uses this enumeration as its data type e.g., via a reference.

Is this allowed by the OPC UA specification?

If so, where is this explicitly defined in the base specification?

Avatar
Randy Armstrong
Admin
Forum Posts: 1620
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
04/24/2025 - 18:53
sp_Permalink sp_Print

If you have a Variable that is a Number where the list of Strings is not defined by a DataType then use MultiStateDiscreteType.

https://reference.opcfoundatio…..cs/5.3.3.3

Avatar
Martin Lang
Germany
Member
Members
Forum Posts: 75
Member Since:
06/25/2014
sp_UserOfflineSmall Offline
3
04/25/2025 - 01:14
sp_Permalink sp_Print

I try to show my question with an example:

Root

  |->Objects

           |->MyVariable (DataType Enumeration -> HeaterStatus)

                      |->EnumStrings (ns=3;i=3001) (Is it allowed to reference the EnumStrings property directly from the DataType?)

 …

  |-> DataType -> BaseDataType -> Enumeration -> HeaterStatus -> EnumStrings (ns=3;i=3001)

 

I checked some example servers where the EnumStrings only exists at the Enumeration definition.

Where is this defined in the specification?

Avatar
Randy Armstrong
Admin
Forum Posts: 1620
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
04/26/2025 - 15:26
sp_Permalink sp_Print

You can use EnumStrings on any variable since it is not explicitly prohibited.

The issue is best practices.

If you have an Enumeration DataType then it is on the DataType and does not need to be replicated.

But, for convenience, a Variable could have an HasProperty reference to the DataType Property.

Avatar
Martin Lang
Germany
Member
Members
Forum Posts: 75
Member Since:
06/25/2014
sp_UserOfflineSmall Offline
5
04/28/2025 - 05:24
sp_Permalink sp_Print

Thank you for clarification, I created a Mantis issue https://mantis.opcfoundation.o…..p?id=10307.

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