I added the PropertyType "StringProperty" as a children of the Server Object. The generated code can't compile because there is an error in the create-instances part for the PropertyType in the nodemanager.cpp file.
I think the last two parameters in the "addNodeAndReference" method are wrong.
If I correct them like this, I can compile but the DataType is still wrong.
addNodeAndReference(UaNodeId(OpcUaId_Server, NodeManagerRoot::getTypeNamespace()), pVariableType, referenceTypeId);
I hope you have a hint what I can do.
This is the wrong part in the nodemanager.cpp file.
------------------------------------------------------------
// Create instances
// ------------------------------------------------------------
UaVariant defaultValue;
defaultValue.setInt32(0);
UaNodeId parentNodeId;
UaNodeId referenceTypeId;
OpcUa::BaseObjectType* pObjectType;
OpcUa::BaseVariableType* pVariableType;
UaNode* pParent;
//StringProperty
pVariableType = new OpcUa::PropertyType(UaNodeId(6002, getTypeNamespace()), "StringProperty",getTypeNamespace(), defaultValue, 3, this);
referenceTypeId = UaNodeId(46, NodeManagerRoot::getTypeNamespace());
addNodeAndReference(UaNodeId(OpcUaId_Server, NodeManagerRoot::getTypeNamespace()), pStringProperty, );
PropertyType with DataType=String as a Children of the Server Object causes an error in the code.
Moderator: uamodeler
-
- Hero Member
- Posts: 21
- Joined: 07 Oct 2012, 11:18
- Support Team
- Hero Member
- Posts: 3070
- Joined: 18 Mar 2011, 15:09
Re:PropertyType with DataType=String as a Children of the Server Object causes an error in the code.
Hi,
Thank you reporting this bug.
To set the DataType correctly you have to set the default value like this:
Best Regards,
Unified Automation Support Team
Thank you reporting this bug.
To set the DataType correctly you have to set the default value like this:
Code: Select all
defaultValue.setString("");
Unified Automation Support Team
Best regards
Unified Automation Support Team
Unified Automation Support Team
-
- Hero Member
- Posts: 21
- Joined: 07 Oct 2012, 11:18
Re:PropertyType with DataType=String as a Children of the Server Object causes an error in the code.
Thanks for that hint. It works for me.
But there is no way to fix this during the modelling process in the uaModeler?
But there is no way to fix this during the modelling process in the uaModeler?
- Support Team
- Hero Member
- Posts: 3070
- Joined: 18 Mar 2011, 15:09
Re:PropertyType with DataType=String as a Children of the Server Object causes an error in the code.
UaModeler 1.2 will fix this. There is no way to fix this during the modelling process in the UaModeler 1.1.
Best regards
Unified Automation Support Team
Unified Automation Support Team