Parsing nodeset files with UAVariable tags that are missing or have empty value tags | OPC UA Standard | Forum

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
Parsing nodeset files with UAVariable tags that are missing or have empty value tags
Avatar
Jonas Green
Halmstad, Sweden
Member
Members
Forum Posts: 21
Member Since:
05/24/2017
sp_UserOfflineSmall Offline
1
09/30/2021 - 05:00
sp_Permalink sp_Print

Hi,

We are testing our nodeset parser by parsing companion specification nodesets. We have found e.g. UAVariable tags that are either missing the value tag or the value tag is there but without any value. How shall we treat these setups? Should it translate to null value or default value per data type? Also, where can we find the default value per data type specified?

Without Value tag:
 
  <UAVariable NodeId="ns=1;i=6829" BrowseName="1:EngineeringUnits" ParentNodeId="ns=1;i=2001" DataType="EUInformation" AccessLevel="3" UserAccessLevel="3">
    <DisplayName>EngineeringUnits</DisplayName>
    <References>
      <Reference ReferenceType="HasProperty" IsForward="false">ns=1;i=2001</Reference>
      <Reference ReferenceType="HasModellingRule">i=78</Reference>
      <Reference ReferenceType="HasTypeDefinition">i=68</Reference>
    </References>
  </UAVariable>
With Value tag, but without value (String):
 
  <UAVariable NodeId="ns=1;i=6862" BrowseName="1:AuxParameters" ParentNodeId="ns=1;i=1006" DataType="String" ValueRank="1" AccessLevel="3" UserAccessLevel="3">
    <DisplayName Locale="en">AuxParameters</DisplayName>
    <Description Locale="en">Array of auxiliary parameter for additional alarm description.</Description>
    <References>
      <Reference ReferenceType="HasProperty" IsForward="false">ns=1;i=1006</Reference>
      <Reference ReferenceType="HasModellingRule">i=80</Reference>
      <Reference ReferenceType="HasTypeDefinition">i=68</Reference>
    </References>
    <Value>
      <uax:ListOfString xmlns:uax="https://opcfoundation.org/UA/2008/02/Types.xsd" />
    </Value>
  </UAVariable>

 

Thanks, Jonas.

Avatar
Randy Armstrong
Admin
Forum Posts: 798
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
09/30/2021 - 07:24
sp_Permalink sp_Print

You should set the status to BadConfigurationError and keep the empty Variant.

If the Value type does not match the DataType/ValueRank set the status to BadTypeMismatch and set the value to NULL.

You can also set the value to the default for the DataType and set the status to UncertainInitialValue or GoodLocalOverride.

The 1.05 RC for Part 6 has default values for every type in Table 1 (the latest version is in SharePoint).

Avatar
Jonas Green
Halmstad, Sweden
Member
Members
Forum Posts: 21
Member Since:
05/24/2017
sp_UserOfflineSmall Offline
3
10/12/2021 - 03:13
sp_Permalink sp_Print

Randy Armstrong said
You should set the status to BadConfigurationError and keep the empty Variant.

If the Value type does not match the DataType/ValueRank set the status to BadTypeMismatch and set the value to NULL.

You can also set the value to the default for the DataType and set the status to UncertainInitialValue or GoodLocalOverride.

The 1.05 RC for Part 6 has default values for every type in Table 1 (the latest version is in SharePoint).

  

Thanks for the response! We got a follow up question on the same theme.

We have encountered several companion specifications that define variable types without specifying datatype. In chapter 5.9 of Part 3 (1.04) the "Overview of Attributes" table specifies that the DataType attribute is mandatory for VariableType. What type should we set if there is no type specified by the nodeset? Should we default to BaseDataType?

Link to an example of a variable type without data type: https://github.com/OPCFoundati......xml#L7711

Avatar
Randy Armstrong
Admin
Forum Posts: 798
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
10/12/2021 - 06:54
sp_Permalink sp_Print

Yes, assume BaseDataType if DataType omitted.

Avatar
Paul Hunkar
Cleveland, Ohio, USA
Moderator
Members

Moderators-Specifications

Moderators-Companion

Moderators-Implementation

Moderators-Certification
Forum Posts: 95
Member Since:
02/24/2014
sp_UserOfflineSmall Offline
5
10/12/2021 - 21:35
sp_Permalink sp_Print

The VariableType you referenced as an example is a subtype of a type that does define a DataType of BaseDataType.  SubTypes inherit what the parent type has, they are allowed to overwrite it with something more specific.

Paul Hunkar - DSInteroperability

Forum Timezone: America/Phoenix
Most Users Ever Online: 202
Currently Online:
Guest(s) 18
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 9
Topics: 966
Posts: 3021