namespace ?

General topics regarding OPC Foundation and communication technology in general.

Moderator: Support Team

Post Reply
mail@reinerdoll.de
Jr. Member
Jr. Member
Posts: 3
Joined: 25 Nov 2015, 11:49

namespace ?

Post by mail@reinerdoll.de »

i am looking now for hours to understand the meaning of "ns = x".
i have two opcua servers running, and both connect two several plc (simatic s7 300).
one server (ignition gateway) has my tags (e.g. DB20.B0) under ns=1; s=[devicename]tagname, the other has ns=2; s= .
i did not find a possibility, to configure the ns-numbers in the opc-servers. so i do not understand, how i can find out the ns-number without browsing the server by grafical client.

sorry for the stupid question and my poor english ;-)

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

Re: namespace ?

Post by Support Team »

Hello,

The namespace index is defined by the server. It can be chosen more or less arbitraryly by the server.
The client has to be implemented in such a way, that the operation is independant of the namespace index.

Best regards
Support Team

mail@reinerdoll.de
Jr. Member
Jr. Member
Posts: 3
Joined: 25 Nov 2015, 11:49

Re: namespace ?

Post by mail@reinerdoll.de »

i am sorry, but also looking hard for examples of namespace-independent adressing in opc-client software, i did not find a solution.
can anyone give me a link or an example of a item-adress in opc.tcp:// without using namespace-numbers ?


thanks a lot !

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

Re: namespace ?

Post by Support Team »

Hi,

It is a very basic concept of OPC UA that a Node in OPC UA is addressed by a namespace URI and an identifier. The namespace index in the NodeId is just a server specific short-cut for the namespace URI.

Every useful client sample code shows how to get the namespace index for a known namespace URI.

There is no namespace independent addressing in OPC UA.

Best Regards,
Unified Automation Support Team

mail@reinerdoll.de
Jr. Member
Jr. Member
Posts: 3
Joined: 25 Nov 2015, 11:49

Re: namespace ?

Post by mail@reinerdoll.de »

i have problems to understand these two answers :

a) The client has to be implemented in such a way, that the operation is independant of the namespace index. (11.jan)
b) There is no namespace independent addressing in OPC UA. (18.jan)

either there is a way to adress a tag in programming a client without knowing the namespace-numers (such as "ns=2")
or there is way to find out these numbers.

or must i really test with a graphical client to find out ? with my plcs (simatic s7) which do not support browsing, its a hard job.

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

Re: namespace ?

Post by Support Team »

Hi,

Both statements are right. The problem is that you need to understand the difference between a namespace (URI) and a namespace index. The namespace index is just valid for a connection to the server. It may change for the next connect. What is stable is the namespace URI. A client must translate the namespace URI to a namespace index after connection establishment.

Statement (a) refers to the fact that a client must translate the namespace URI to an index and therefore must be independent of the index.
Statement (b) refers to the question if it is possible to use OPC UA without namespaces. Since every OPC UA server has at least two namespaces, a namespace independent address is not possible.

Best Regards,
Unified Automation Support Team

Post Reply