Create the full namespace 0

Questions regarding the use of the C++ SDK for Server or Client development or integration into customer products ...

Moderator: uasdkcpp

Post Reply
cva
Jr. Member
Jr. Member
Posts: 1
Joined: 03 Apr 2019, 15:57

Create the full namespace 0

Post by cva »

Hi,

my server loads types and instances from a XML-Nodeset-File created by UaModeller. This Nodeset contains several Types (VariableType/ObjectTypes/EventTypes) which is are subtypes of ns=0-Types, e.g. a subtype of ConditionType.

The load failes with these errors, because some nodes from ns=0 are not available:

Code: Select all

13:35:26.576Z|1|4EA8* Error: NodeManagerUaNode::createNodeManagerAliasNode [ret=0x803c0000] - Read config for NodeId = NS0|Numeric|2915
13:35:26.576Z|1|4EA8* Error: NodeManagerUaNode::addUaReference [ret=OpcUa_BadNodeIdUnknown] - Source node not available NS0|Numeric|2915
13:35:26.576Z|1|4EA8* Error UaNodeSetXmlParserUaNode::startUp - cannot add reference from NodeId i=2915 to NodeId ns=2;i=1042
13:35:26.579Z|1|4EA8* Error: UaCoreServerApplication::start - can not start up module [ret=0x80340000]
I found a workaround by creating my own nodemanager, which creates instances of the required ns=0 types, on which the corresponding types are created in ns=0.

e.g.

Code: Select all

/// Create AnalogItemType in ns=0
UaVariant defaultValue;
auto pAnalogItem = new OpcUa::AnalogItemType(
	UaNodeId(60000, getNameSpaceIndex()),
	"Dummy",
	getNameSpaceIndex(),
	UaVariant(),
	Ua_AccessLevel_CurrentRead,
	this);
pAnalogItem->releaseReference();

/// Create AlarmConditionType in ns=0
OpcUa::OffNormalAlarmType* pOffNormalAlarm = new OpcUa::OffNormalAlarmType(
	UaNodeId(60001, getNameSpaceIndex()), // NodeId of the node
	"Dummy",      // Name of the node used for browse name and display name
	getNameSpaceIndex(),   // Namespace index of the browse name
	this,                  // Node manager responsible for this node
	UaNodeId(),             // NodeId of the source node
	"DummyName"
	); // Name of the source node
pOffNormalAlarm->releaseReference();
Is there any solution to create all types from ns=0 in the address-space without creating a dummy nodemanager and dummy-Instances?

Greetings
cva

SDK-Version 1.6.3 32bit (binary)
Windows 10, Visual Studio 2015

Post Reply