Best practice for exposing enumeration values|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
Best practice for exposing enumeration values
Avatar
EG
Member
Members
Forum Posts: 35
Member Since:
12/06/2021
sp_UserOfflineSmall Offline
1
03/09/2023 - 13:01
sp_Permalink sp_Print

I am trying to understand if my method of exposing enumeration values is best practice.

My current strategy has been to do something similar to the following:

  • Define an Enumeration DataType
  • Define an EnumStrings Property on the above Enumeration containing the LocalizedText values
  • Define Variable instances with TypeDefinitionn BaseDataVariableType, and DataType as the above Enumeration

Given those three components, it is possible for clients (e.g. UaExpert) to show the localized text for the variables current value.

However I am unsure about whether MultiStateDiscreteType is supposed to be used instead. What is the rationale behind this type? Would it be better to use MultiStateDiscreteType instead?

Avatar
Randy Armstrong
Admin
Forum Posts: 1568
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
03/09/2023 - 15:45
sp_Permalink sp_Print sp_EditHistory

What you are doing makes sense for generic enumerations that can be used on any variable.

The MultiStateDiscreteType is for process values (i.e. values that are coming from a sensor or GPIO).

MultiStateDiscreteType cannot be used on a Property and you need to create a subtype if you want to re-use the same set of EnumStrings.

Avatar
Paul Hunkar
Cleveland, Ohio, USA
Moderator
Members

Moderators-Specifications

Moderators-Companion

Moderators-Implementation

Moderators-Certification

Moderators-COM
Forum Posts: 112
Member Since:
02/24/2014
sp_UserOfflineSmall Offline
3
03/11/2023 - 23:19
sp_Permalink sp_Print

If you are building an information model, the MultiStateDiscreteType is used when every instance of the given variable may have a unique set of enumerations.  If you define a type where a variable has a DataType of a specific enumeration, all instance of that variable will always have the given enumeration.  So it depends on what it is you are trying to model -  if you are building a model for a pump and it has two state "Running" / "Stopped" then then enumeration makes more sense.  I f your model would have a verity of states that could be displayed depending on the given instance say one instance is Running/Stopped next instance has On/Off/initialize/error and a third instance off/lowspeed/mediumSpeed/HighSpeed, then the MultiStateDiscreteType makes more sense.

Paul Hunkar - DSInteroperability

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