Creating Instance Nodes in Namespace 1 with Type Dependencies in Higher Namespaces

Questions regarding the use of UaModeler

Moderator: uamodeler

Post Reply
slivkinelad
Jr. Member
Jr. Member
Posts: 2
Joined: 13 Jun 2024, 07:15

Creating Instance Nodes in Namespace 1 with Type Dependencies in Higher Namespaces

Post by slivkinelad »

Hi,
I'm using UAModeler to generate OPC UA server code and encountering a namespace constraint issue.
Setup:

Opc.Ua.NodeSet2 (namespace 0)
Server-specific nodes (namespace 1)
Opc.Ua.Di.NodeSet2 (e.g., namespace 2)
Industry-specific companion spec NodeSet2 (e.g., namespace 3)
Equipment-specific companion spec NodeSet2 (e.g., namespace 4, depends on DI and namespace 3)

Requirement:
My customer is migrating from an existing OPC UA server where equipment instances are located in namespace 1.
To maintain compatibility with their existing client applications, they require the same namespace structure in the new server.
Issue:
UAModeler appears to prevent creating instances in namespace 1 when:

1)The instance types are defined in higher namespaces (3-4)
2)The instances need to be created under the "DeviceSet" (ns2) node from the DI namespace
3)The type definitions have dependencies on multiple companion specifications

Since the type definitions exist in namespaces with indices higher than 1, UAModeler seems to enforce that instances must be created in an even higher namespace.

Question:
Is there a configuration option or recommended approach in UAModeler to create instances in namespace 1 when their types are defined in higher namespaces? This is needed for backward compatibility with existing client applications.
Has anyone encountered this scenario and found a solution?
Thank you!

User avatar
Support Team
Hero Member
Hero Member
Posts: 3341
Joined: 18 Mar 2011, 15:09

Re: Creating Instance Nodes in Namespace 1 with Type Dependencies in Higher Namespaces

Post by Support Team »

Hi,

no it is not possible to create instances in namespaces without having loaded the parent namespaces beforehand. This is by design of OPC UA specification, the namespaces must be loaded in correct order.

As you have already noticed, each namespace has URI and index, whereas the "U" in URI translates to "unique", which means that the NamespaceURI is uniquely identifying the namespace, but the NamespaceIndex is just some (not-unique) number. Every OPC UA Client must automatically resolve the URI into the index at every single connect, because the "index" can change at every restart of the server. If your Client is not capable of doing "on the fly index replacements in NodeIDs, depending on thre URI", it is not compliant to the OPC UA specification (and some poor implementation). The server can only have server specific instances in namespace "1" (which all depend on "0"). If you have equipment specific Nodes in "1" the server seems also to be some poor implementation. The concepts of "namespaces" in OPC UA are a fundamental part of the specification, unfortunately misunderstood by many implementers.

Therefore the only solution (independent to your customer's wishes) to your problem is: "repair your client software", because is non-compliant and wrong.
Best regards
Unified Automation Support Team

Post Reply