Namespace index in BrowseName vs NodeId | OPC UA Standard | Forum

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Namespace index in BrowseName vs NodeId
Avatar
Thomas Wirtz-Baumann
Member
Members
Forum Posts: 7
Member Since:
06/02/2020
sp_UserOfflineSmall Offline
1
10/12/2021 - 06:36
sp_Permalink sp_Print sp_EditHistory

Hello,

I would like to get some clarifications about the expected behavior of the BrowseName when creating an instance of an object.

Suppose I have multiple namespaces:

  • 0: OPC foundation
  • 1: My server namespace
  • 2: Another namespace with type definitions

Instances are created into the namespace with index 1.

Suppose I create an object from a type definition from namespace with index 2.

The created object will have a node ID where the namespace index will be 1. What should be the namespace index in the BrowseName of that object instance:

  1. Should it be also the index of the namespace where the instance is created (1 in the example)?
  2. Should it be the index of the namespace where the type is defined (2 in the example)?
  3. It does not matter?

Thanks

Avatar
Randy Armstrong
Admin
Forum Posts: 798
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
10/12/2021 - 07:02
sp_Permalink sp_Print

If you create a standalone instance of an object or variable the you give it a new BrowseName with an index in any namespace that is appropriate (i.e. if you create an instance of PropertyType to represent the well-known Property "NodeVersion" on a Node then the namespace index is 0).

You should use the NodeId namespace the the BrowseName is not defined in another model.

If you create an instance while instantiating the tree under a new object or variable the BrowseName namespace is exactly the same as the InstanceDeclaration in the ObjectType or VariableType.

Avatar
Thomas Wirtz-Baumann
Member
Members
Forum Posts: 7
Member Since:
06/02/2020
sp_UserOfflineSmall Offline
3
10/13/2021 - 09:25
sp_Permalink sp_Print

Hi Randy,

Regarding your last statement about instantiating the tree under a new object, I would like to take an example to illustrate.

Suppose I defined an object type MyObjectType in the namespace with index 2. This object type has:

  • a child variable MyVariable
  • and a child object MyOtherObject with object type MyOtherObjectType defined into the namespace index say 3.

In addition, the object type MyOtherObjectType has a child variable MyOtherVariable.

Now I create an object instance MyObject into the namespace with index 1 from the object type MyObjectType. The resulting BrowseName in the instance object tree would be:

  • MyObject has BrowseName "1:MyObject" (node ID being "ns=1;something)
  • MyVariable has BrowseName "2:MyVariable" (node ID being "ns=1;something else) since the corresponding InstanceDeclaration is in namespace 2
  • MyOtherObject has BrowseName "2:MyOtherObject" (node ID being "ns=1;something else) since the corresponding InstanceDeclaration is in namespace 2
  • MyOtherVariable has BrowseName "3:MyOtherVariable" (node ID being "ns=1;something else) since the corresponding InstanceDeclaration is in namespace 3

Is this what you meant with your last statement?

Thanks

Avatar
Randy Armstrong
Admin
Forum Posts: 798
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
10/13/2021 - 14:27
sp_Permalink sp_Print

Yes.

Avatar
Thomas Wirtz-Baumann
Member
Members
Forum Posts: 7
Member Since:
06/02/2020
sp_UserOfflineSmall Offline
5
10/13/2021 - 22:22
sp_Permalink sp_Print

Thank you very much Randy for these clarifications.

Forum Timezone: America/Phoenix
Most Users Ever Online: 202
Currently Online: Hotline Ordinal
Guest(s) 22
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 9
Topics: 966
Posts: 3021