Avatar
Please consider registering
guest
sp_LogInOut Log Insp_Registration Register
Register | Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSSsp_TopicIcon
Duplicate namespace name in namespace table?
September 21, 2021
15:49, EEST
Avatar
rocket science
Member
Members
Forum Posts: 105
Member Since:
March 16, 2017
sp_UserOfflineSmall Offline

HI,

I’ve seen something strange at an OpcUa server…. in the namespace table there is the same namespace name used for different indexes.

NamespaceTable
[0] http://opcfoundation.org/UA/
[1] urn:com01/OpcUaServer
[2] urn:com01/OpcUaServer

I could not find an answer in the OpcUa reference, but as I know, namespaces should be indentified by it’s name and not by index (because the index can change after a server restart). So in the case above it is impossible to indentify a node using the namespace name, because based on the namespace name I will have two different indexes.

In this particular case there are also two Nodes with the same name but different namespace, which makes it really impossible to identify the node by using the namespace name.

ns=1;s=MyNode
ns=2;s=MyNode

So, the big questions is if it is allowed to have duplicate namespace names in the namespace table and if yes how to deal with it for identifying the nodes using the namespace name and the NodeId?

September 21, 2021
16:55, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1068
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Each entry must be unique, thus that is not a valid OPC UA server. Pretty much a no can do situation. https://reference.opcfoundatio…..rt5/6.3.1/:

“NamespaceArray defines an array of namespace URIs. This Variable is also referred as namespace table. The indexes into the namespace table are referred to as NamespaceIndexes. NamespaceIndexes are used in NodeIds in OPC UA Services, rather than the longer namespace URI. Index 0 is reserved for the OPC UA namespace, and index 1 is reserved for the local Server.”

Though… technically that part doesn’t say unique. But that can be inferred from the usage https://reference.opcfoundatio…..rt3/8.2.2/
“Namespace URIs, like Server names, are identified by numeric values in OPC UA Services to permit more efficient transfer and processing (e.g. table lookups). The numeric values used to identify namespaces correspond to the index into the NamespaceArray. “

Basically the index is just an optimization thing, thus an uri cannot have 2 indexes.

September 21, 2021
17:46, EEST
Avatar
rocket science
Member
Members
Forum Posts: 105
Member Since:
March 16, 2017
sp_UserOfflineSmall Offline

Hi Bjarne,

thanks for your answer. I guess it’s a self-made OpcUa-Server were they messed up something. It’s good to hear that the URI shall be unique.

Thanks!

January 13, 2022
14:16, EET
Avatar
rocket science
Member
Members
Forum Posts: 105
Member Since:
March 16, 2017
sp_UserOfflineSmall Offline

Just to give here also the information….

Namespace URIs shall be unique. OpcFoundation will add an explicit statement to the specifiaction and will also add it as test case to the complience tests.

see also … https://forum.prosysopc.com/fo…..nce/#p5852

Forum Timezone: Europe/Helsinki
Most Users Ever Online: 1919
Currently Online:
Guest(s) 56
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 100
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 773
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1558
Posts: 6567
Newest Members:
aracelyhaley4, raphaelschonell, Ashmag, kathyreimann56, brittanylemos, dorthycundiff76, PromotionToold, CHHinrichs, rodricklienhop, jose_Wanderlei
Moderators: Jouni Aro: 1039, Pyry: 1, Petri: 1, Bjarne Boström: 1054, Jimmy Ni: 26, Matti Siponen: 359, Lusetti: 0
Administrators: admin: 1