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

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: 19
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: 1564
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: 19
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: 1564
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: 19
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.

Avatar
Arno Weiss
Member
Members
Forum Posts: 3
Member Since:
04/27/2021
sp_UserOfflineSmall Offline
6
02/04/2022 - 15:48
sp_Permalink sp_Print

This means the index of the BrowseName should always correspond to the NamespaceIndex of the node at the end of the hasTypeDefinition-reference, right?

Does the same hold true for the text-section of the QualifiedName? If yes, that would mean that the only way to differentiate between Instance and Type from a BrowsePath would be to check whether a node is in the "Objects" or "Types" folder.

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
7
02/05/2022 - 05:51
sp_Permalink sp_Print sp_EditHistory

The UA type model depends on being able to construct paths from the BrowseNames of nodes in the tree under the types.

So it is a requirement that the BrowseName (index and text) be identical.

The only way to identify an InstanceDeclaration is to look for the HasModellingRule reference.

Instances should not have them but I do not believe that is specifically required in the specification.

You can also follow inverse hierarchical references. If a path leads to a type and each Node in the path has a ModellingRule then it is an InstanceDeclaration.

Note that it is allowed for an instance to reference the types InstanceDeclaration instead of creating a copy.

This allows instances to have "static" properties that are shared among all instances of the type.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 34
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1435
Posts: 4855