Custom enumeration

Questions regarding the use of the UaExpert.

Moderator: uaexpert

Post Reply
Sebastian
Full Member
Full Member
Posts: 6
Joined: 24 Aug 2017, 10:06

Custom enumeration

Post by Sebastian »

Hi,
I have my own server running (based on your Net SDK) and using a custom enumeration type created by the UA Modeler.
Now when I use the UA Expert to view the value it just shows me integer number instead of the string I defined for this number.

I'm not exactly sure if this is just a problem with the UA Expert or if I am doing something wrong with the UA Modeler or in my Server.
I hope anyone can help me with this.

Thanks!

Trond
Jr. Member
Jr. Member
Posts: 2
Joined: 18 Sep 2017, 09:13

Re: Custom enumeration

Post by Trond »

This can be read through the optional ValueAsText property (if implemented by the server) - see 5.6.2 in OPC UA Part 3, v1.0.2.
"Only used for DataVariables having an Enumeration DataType. This optional Property provides the localized text representation of the enumeration value. It can be used by clients only interested in displaying the text to subscribe to the Property instead of the value attribute."

Otherwise, you should read your custom enumeration type to translate the numeric value to a LocalizedText.

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

Re: Custom enumeration

Post by Support Team »

Hello Sebastian,

if the enumeration in the server address space is set up correctly, UaExpert will automatically read out the enumeration info in the types tree and use it to display the string representation of the enum values in all views of UaExpert.

Please check that
- the UaExpert setting General.TypeDictionaryMode is set to Reconnect
- there are no warnings being displayed in the log window of UaExpert when connecting to the server
- the enum can be found below Types/DataTypes/BaseDataType/Enumeration and has a EnumStrings or EnumValues property containing the correct values
- the DataType attribute of the variable you are reading is set to the enum's NodeId instead of the NodeId of Int32 (i=6)
Best regards
Unified Automation Support Team

Post Reply