OPC UA Addressing

Server Addressing

The address of a server using the OPC UA binary encoding is known as an Endpoint URL and is expressed as:

opc.tcp://server:port/path

where:

  • "opc.tcp://"   The protocol specifier for OPC UA binary protocol.
  • server   The name of the server.
  • :port   The TCP port number to use on the server. (Note the colon.) :4840 is the IANA registered port number for OPC UA, but this may not be used by your device.
  • /path      Optional path on the server. May not be needed in all circumstances.

For example:

opc.tcp://opctest.trihedral.com:46233/Office/Monitoring

Node Addressing

I/O tags provide an address that identifies the data item it reads data from (or writes data to). In OPC UA, addresses are textual and their content is defined by the server. There is a standard set of addresses defined by the OPC Foundation that are numeric in nature but beyond that, the server implementation is free to structure addresses within defined rules. The address space is divided into namespaces and within the namespaces, Node IDs. Nodes are interlinked with other nodes and are often represented as a tree structure. This is also the way VTScada represents the nodes through the OPC UA client driver address assist.

 

A Node ID comprises a namespace (an integer, that can be omitted if using namespace 0) and an identifier that can be an integer, a string, a guid, or an opaque set of bytes. This two elements are identified in the I/O address string by the items "ns" and "id" respectively.

When the Node ID is encoded to be transmitted, a choice must be made on how to encode it. An integer can be transmitted in several shorter forms depending on the size of the number, and string, GUID and opaque elements are encoded as is normal in OPC UA for those data types. The encoded data has a field indicating the identifier type, the values for which are 0 (integer), 1 (string), 2 (GUID) and 3 (opaque bytes).

 

As this encoding must be persisted in the I/O address, the type is specified by the introducer "nt" (for NodeID Type). This was added to VTScada in version 12.0.24 Any existing I/O address strings without the "nt" element will work as they did before, automatically inferring the type, but any new addresses received via OPC UA address assist will have the "nt" element. If adding addresses manually, the appropriate "nt" element should be specified. If it is not, the old inference rules will be applied. This will most notably affect node identifiers that are numeric but should be encoded as strings.

 

VTScada always formats node addresses as follows:
(Square brackets indicate optional parts. They are not part of the address. Replace XXX with the relevant value.)

[ns=XXX;]id=XXX;nt=XXX[;at=XXX][;ty=XXX]

where:

ns Namespace identifier
Optional. Defaults to numeric zero. The server node addresses are divided into namespaces, with namespace 0 being the set of OPC Foundation-defined, reserved node addresses.
id Node identifier
Mandatory. The identifier is a text string that can represent an integer, a string, a GUID or an opaque set of bytes. It is assigned by the server to this node.
nt

Node ID Type

Mandatory. Defines the type of the NodeID (Identifier type, not data type.) The value of this parameter is numeric, as defined by part 3 of the OPC Foundation's OPC UA specification, section 8.2.3, table 23

at

Attribute
Optional. The attribute specifies which of the (usually many) attributes the address refers to. An attribute is a numeric value between 1 and 27 defined by the OPC Foundation. (See part 6 of the OPC Foundation’s OPC UA specification, Annex A).

VTScada’s address assist helpfully translates these to the same text names as provided in that reference. For example, Value is attribute number 13.

ty

Type
Optional for reads, mandatory for writes. Specifies the type of the attribute supplied to VTScada from the server. This assists with the correct encoding of the data value when writing a VTScada value to the server. Most of the time VTScada can decode data based on information returned with the data value from the server without this hint.

The type values are defined in part 6 of the OPC Foundation’s OPC UA specification, section 5.1.2.

For example:

ns=2;id=West_WTP_Ambient_Temp;at=13;ty=11

identifies the Value attribute (attribute 13) of the server node "West_WTP_Ambient_Temp" in namespace 2. The Value has a type of 11, which is an IEEE double precision (64-bit) floating point value.

 

OPC UA Address Assist

The OPC UA Client Driver provides address assist for any I/O tags using this driver.

As with other drivers, address assist is activated via the button next to the address field of the I/O tab on an I/O tag configuration folder. For the OPC UA Client Driver, the button is labelled "OPC UA".

Address assist is only available on the computer that is the current server for the driver as communication with the server is necessary in order to obtain OPC UA address space information. The address assist button will be disabled if this is not the case.

Clicking the address assist button opens a separate window divided into a tree view, on the left, and an attribute view on the right.

The tree view displays the hierarchical arrangement of the "nodes" configured on the OPC UA server.

The OPC UA nodes displayed in the tree view are restricted to objects, variables and views. Any node in the tree that has child nodes of these types is represented as an expandable folder to allow navigation to the children.

An OPC UA node contains various attributes that describe the item. Those nodes that possess a Value attribute may be assigned to an I/O tag. The I/O tag’s value will be the node’s Value. For input tags, the I/O tag’s value will be updated using the OPC UA Subscription service. For output tags, the OPC UA server’s value will be updated using the Write method of the Attribute service.

VTScada does not currently support assigning node attributes other than Value to I/O tags via the address assist dialog. If you need to select a different attribute, you must enter the address of the attribute manually.

Tags with blue dots denote variables that are properties (see following image). These are always leaf nodes; they can never have any variables under them. These can be thought of as meta-data about the parent node, not meant to change often. Refer to the definitions provided in the OPC UA Online Reference.

When opening the address assist for an I/O tag that already has an address within the OPC UA server’s address space, the tree will be automatically expanded to the node with that address. This is only possible if the OPC UA server supports reverse browsing, i.e. identifying "parent" links from a node. In the case where this is not supported by the server, the tree will not be automatically expanded.

The format of node addresses supported by the VTScada OPC UA Client Driver is described in Node Addressing.