Problem with different Namespaces in uaModeler and uaExpert
Hello,
I hope this is the right forum.
I have the following namespaces in the uaModeler:
0 http://opcfoundation.org/UA/
1 http://opcfoundation.org/UA/DI/ setDescription(UaLocalizedText("en", "Contains all instances of devices" )) ;
addNodeAndReference(UaNodeId(OpcUaId_ObjectsFolder, NodeManagerRoot::getTypeNamespace()), pDeviceSet, OpcUaId_Organizes);
Then I have the "DeviceSet" with the wrong namespace index 4.
I tried: OpcUaDi::NodeManagerDevices::getTypeNamespace() but this returns a "0".
Question 1:
Why is there a difference in the namespace index 1?
Question 2:
What is a good strategy to generate "myModel_2_instances" in the running/starting server?
(It should be a device, with types form the myModel_2_types model, that is organized by the DeviceSet Object)
Thank you very much for the good support so far
Best regards
Problem with different Namespaces in uaModeler and uaExpert
Moderator: uamodeler
-
- Hero Member
- Posts: 21
- Joined: 07 Oct 2012, 11:18
- Support Team
- Hero Member
- Posts: 3069
- Joined: 18 Mar 2011, 15:09
Re:Problem with different Namespaces in uaModeler and uaExpert
Hi,
(1) Namespace Index
The namespace index is just a temporary handle. It is not used to identify a namespace in a tool or a server. Only the URI of the namespace (like http://opcfoundation.org/UA/DI/) is unique. The index is assigned by the tool or server and may change when restarting the server / tool or when additional namespaces are added.
(2) Namespace Index 1 in server
Namespace index 0 in a server is reserved for http://opcfoundation.org/UA/
Namespace index 1 in a server is reserved for nodes specific to a server like diagnostic nodes. The URI matches the ServerUri.
The index assignment is not defined for tools. They may assign any index to any namespace URI
(3) Namespace http://opcfoundation.org/UA/DI/
The C++ SDK has support for the DI namespace but you must create the corresponding NodeManager when you want to use the namespace. This does also create the DeviceSet object.
The following code must be added to the server main before you instantiate your depending NodeManagers:
Best Regards,
Unified Automation Support Team
(1) Namespace Index
The namespace index is just a temporary handle. It is not used to identify a namespace in a tool or a server. Only the URI of the namespace (like http://opcfoundation.org/UA/DI/) is unique. The index is assigned by the tool or server and may change when restarting the server / tool or when additional namespaces are added.
(2) Namespace Index 1 in server
Namespace index 0 in a server is reserved for http://opcfoundation.org/UA/
Namespace index 1 in a server is reserved for nodes specific to a server like diagnostic nodes. The URI matches the ServerUri.
The index assignment is not defined for tools. They may assign any index to any namespace URI
(3) Namespace http://opcfoundation.org/UA/DI/
The C++ SDK has support for the DI namespace but you must create the corresponding NodeManager when you want to use the namespace. This does also create the DeviceSet object.
The following code must be added to the server main before you instantiate your depending NodeManagers:
Code: Select all
OpcUaDi::NodeManagerDevices* pNmDI = new OpcUaDi::NodeManagerDevices;
pServer->addNodeManager(pNmDI);
Unified Automation Support Team
Best regards
Unified Automation Support Team
Unified Automation Support Team
-
- Jr. Member
- Posts: 2
- Joined: 29 Mar 2016, 09:55
Re: Problem with different Namespaces in uaModeler and uaExp
Please let me know when I run this code:
How do I know the namespace index of pNmDI?
Code: Select all
OpcUaDi::NodeManagerDevices* pNmDI = new OpcUaDi::NodeManagerDevices;
pServer->addNodeManager(pNmDI);
- Support Team
- Hero Member
- Posts: 3069
- Joined: 18 Mar 2011, 15:09
Re: Problem with different Namespaces in uaModeler and uaExp
Hello,
You can call
after calling
You can call
Code: Select all
pNmDI->getNameSpaceIndex();
Code: Select all
pServer->start();
Best regards
Unified Automation Support Team
Unified Automation Support Team