Page 1 of 1

namespace ?

Posted: 09 Jan 2016, 14:26
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 ;-)

Re: namespace ?

Posted: 11 Jan 2016, 15:56
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

Re: namespace ?

Posted: 16 Jan 2016, 14:14
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 !

Re: namespace ?

Posted: 18 Jan 2016, 23:12
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

Re: namespace ?

Posted: 20 Jan 2016, 11:23
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.

Re: namespace ?

Posted: 22 Jan 2016, 14:04
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