OPC Item Path syntax

I've always wanted to ask this question, but just haven't. Can someone explain, or point me to the docs that explains, the syntax for OPC Item Path? For example, the following path:

path = "nsu=TOP Server;s=Test_CH.Demo1.!MyTag@Boolean"

What is nsu and s? Also, there is ns.

I'm assuming ns/u is namespace, looks like ns is an index and nsu is unicode?

Since most of the time I'm picking tags by browsing I've really never cared what these meant, but figured I should know this and have struck out finding anything in the docs.

1 Like

ns is namespace index
nsu is namespace URI

The second portion, s=... indicates it's a String-type NodeId, followed by the id itself. There are other types, but most servers just use String. More info here.

When you bring tags in we look at the namespace index and if it's 0 or 1 we use the abbreviated ns= format, and if it's 2+ we use the explicit nsu= format. This is because it's possible that configuration changes to a server result in namespaces other than 0/1 being at different indices in the namespace table. Not common, but possible.

5 Likes