Closed elliot-gawthrop closed 1 year ago
When a variable is modelled as 2+ dimensions, the ModelCompiler generates C# code as if it is a scalar value.
When this is run through the ModelCompiler:
<ObjectType SymbolicName="TypeWithTwoDimensionalVariable" BaseType="ua:BaseObjectType"> <Children> <Variable SymbolicName="X" DataType="ua:Int32" ValueRank="OneOrMoreDimensions" ArrayDimensions="0,0" ModellingRule="Optional"/> </Children> </ObjectType>
the type of the generated C# code is BaseDataVariableState<int>. I expected it to be BaseDataVariableState<int[,]>.
BaseDataVariableState<int>
BaseDataVariableState<int[,]>
The NodeSet2.xml seems to be correct, showing:
<UAVariable NodeId="ns=1;i=422" BrowseName="65535:X" ParentNodeId="ns=1;i=421" DataType="Int32" ValueRank="2" ArrayDimensions="0,0"> <DisplayName>X</DisplayName> <References> <Reference ReferenceType="HasTypeDefinition">i=63</Reference> <Reference ReferenceType="HasModellingRule">i=80</Reference> <Reference ReferenceType="HasComponent" IsForward="false">ns=1;i=421</Reference> </References> </UAVariable>
Fixed
When a variable is modelled as 2+ dimensions, the ModelCompiler generates C# code as if it is a scalar value.
When this is run through the ModelCompiler:
the type of the generated C# code is
BaseDataVariableState<int>
. I expected it to beBaseDataVariableState<int[,]>
.The NodeSet2.xml seems to be correct, showing: