These docs are for v6.1.0. Click to read the latest docs for v7.4.0.

OPC UA Driver

This Driver implements the client side of the OPC UA protocol using the Driver model. The Driver can be used to interact as a client with OPC UA servers using different abstractions, such as the Wires framework, the Asset model or by directly using the Driver itself.

Features

The OPC UA Driver features include:

  • Support for the OPC UA protocol over TCP.
  • Support for reading and writing OPC UA variable nodes by node ID.

## Installation

The Driver is distributed as a deployment package on Eclipse Marketplace for ESF 5.x and 6.x.
It can be installed following the instructions provided here.

Instance creation

A new OPC UA instance can be created either by clicking the New Driver button in the dedicated Drivers and Assets Web UI section or by clicking on the + button under Services. In both cases, the org.eclipse.kura.driver.opcua factory must be selected and a unique name must be provided for the new instance.

Channel configuration

The OPC UA Driver channel configuration is composed of the following parameters:

  • name: the channel name.
  • type: the channel type, (READ, WRITE, or READ_WRITE).
  • value type: the Java type of the channel value.
  • node.id: The node id of the variable node to be used, the format of the node id depends on the value of the node.id.type property.
  • node.namespace.index: The namespace index of the variable node to be used.
  • node.id.type: The type of the node id (see below)

Node ID types

The Driver supports the following node id types:

Node ID TypeFormat of node.id
NUMERICnode.id must be parseable into an integer
STRINGnode.id can be any string
OPAQUEOpaque node ids are represented by raw byte arrays. In this case node.id must be the base64 encoding of the node id.
GUIDnode.id must be a string conforming to the format described in the documentation of the java.util.UUID.toString() method.

Recursive subscriptions to directory children nodes

The driver allows to recursively visit the children of folder node and create a subscription on the value of all discovered variable nodes with a single channel in Asset configuration.

🚧

Note

This procedure can put under stress the gateway and the server if the target folder contains a lot of children nodes.

Channel configuration

In order to configure the driver to perform the discovery operation, a single channel can be defined with the following configuration:

  • type: READ
  • value.type: STRING (see below)
  • listen: true
  • node.id: the node id of the root of the subtree to visit
  • node.namespace.index: the namespace index of the root of the subtree to visit
  • node.id.type the node id type of the root of the subtree to visit
  • listen.subscribe.to.children: true

The rest of the configuration parameters can be specified in the same way as for the single node subscription use case.

The listen.sampling.interval, listen.queue.size and listen.discard.oldest parameters of the root will be used for all subscriptions on the subtree.

Discovery procedure

The driver will consider as folders to visit all nodes that whose type definition is FolderType, that is all nodes with the following reference:

HasTypeDefinition:

  • namespace index: 0
  • node id: 61 (numeric)
  • URN: http://opcfoundation.org/UA/

The driver will subscribe to all variable nodes found.

Event reporting

If the Driver is used by a Wire Asset, it will emit on the wire a single message per received event.

All emitted events will contain a single property, the name of this property is the browse path of the source OPCUA node relative to the root folder defined in channel configuration.

Type conversion

The current version of the driver tries to convert the values received for all events on a subtree to the type defined in the value.type configuration parameter.

Since the value types of the discovered nodes are heterogeneous, the conversion might fail if the types are not compatible (e.g. if value.type is set to INTEGER and the received value is a string).

Setting value.type to STRING should allow to perform safe conversions for most data types.