PackML code generation wrong
See original GitHub issueHi
I notice that the PackML ObjectType PackMLBaseObjectType as defined in https://reference.opcfoundation.org/PackML/v101/docs/6.3.2 in incorrectly generated by the model compiler when taking the official PackML NodeSet2 as input.
All the Mandatory objects Admin, Status, BaseStateMachine are missing as well as the Methods defined on this object.
The generated object type by the Model Compiler is
<UAObjectType NodeId="ns=1;i=6" BrowseName="1:PackMLBaseObjectType"> <DisplayName>PackMLBaseObjectType</DisplayName> <References> <Reference ReferenceType="HasProperty">ns=1;i=221</Reference> <Reference ReferenceType="HasProperty">ns=1;i=218</Reference> <Reference ReferenceType="HasSubtype" IsForward="false">i=58</Reference> </References> </UAObjectType>
while the NodeSet2 input of the model compiler is
<UAObjectType NodeId="ns=1;i=6" BrowseName="1:PackMLBaseObjectType"> <DisplayName>PackMLBaseObjectType</DisplayName> <Documentation>https://reference.opcfoundation.org/v104/PackML/v101/docs/6.3.2</Documentation> <References> <Reference ReferenceType="HasComponent">ns=1;i=73</Reference> <Reference ReferenceType="HasComponent">ns=1;i=88</Reference> <Reference ReferenceType="HasSubtype" IsForward="false">i=58</Reference> <Reference ReferenceType="HasProperty">ns=1;i=221</Reference> <Reference ReferenceType="HasComponent">ns=1;i=403</Reference> <Reference ReferenceType="HasComponent">ns=1;i=404</Reference> <Reference ReferenceType="HasComponent">ns=1;i=400</Reference> <Reference ReferenceType="HasComponent">ns=1;i=402</Reference> <Reference ReferenceType="HasComponent">ns=1;i=401</Reference> <Reference ReferenceType="HasComponent">ns=1;i=362</Reference> <Reference ReferenceType="HasComponent">ns=1;i=87</Reference> <Reference ReferenceType="HasProperty">ns=1;i=218</Reference> </References> </UAObjectType>
The problem is that the C# is also wrong. The point is that the Create method which creates an instance of the PackMLBaseObjectType is creating an incomplete instance albeit the type PackMLBaseObjectType in the Types hierarchy looks ok with UaExpert.
Regards
Issue Analytics
- State:
- Created 2 months ago
- Comments:6 (4 by maintainers)
Added fix to member-only version that handles missing ParentNodeIds if an inverse HasComponent reference exists on the child.
I fixed the NodeSet (added all of the missing ParentNodeIds).
Opc.Ua.PackML.NodeSet2.xml.txt
Builds good code with the member-only ModelCompiler.