I defined my own types in uamodeller then create a tree of instances under object.
But when running the code I only see the objects directly placed under the Object root. It looks like the instances of the other objects are not created.
Looking at the generated code I see this
....
UaNodeId parentNodeId;
UaNodeId referenceTypeId;
....
//SVV1.0
pObjectType = new OpcUa::FolderType(UaNodeId(5001, getTypeNamespace()), "SVV1.0", getTypeNamespace(), this);
referenceTypeId = UaNodeId(35, NodeManagerRoot::getTypeNamespace());
addNodeAndReference(UaNodeId(OpcUaId_ObjectsFolder, NodeManagerRoot::getTypeNamespace()), pObjectType, referenceTypeId);
//Sensor
pObjectType = new SVVNS::VegSensor(UaNodeId(5002, getTypeNamespace()), "Sensor", getTypeNamespace(), this);
addNodeAndReference(parentNodeId, pObjectType, referenceTypeId);
...
I am very new to this sdk but it looks like parentNodeId is never initilized and that the addNodeAndReference call fails.
Changing parentNodeId to a reference to the correct node id solves the issue.
For now I create the instance tree myself, which might not be a bad choice anyway, but I thought I would report this behaviour anyway.
Olivier
error in object structure generated?
Moderator: uamodeler