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?
<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>
<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.
05/30/2017
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).
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
1 Guest(s)