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.
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.
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.
The OPC UA Driver channel configuration is composed of the following parameters:
- name: the channel name.
- type: the channel type, (
- 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)
The Driver supports the following node id types:
Node ID Type
Format of node.id
node.id must be parseable into an integer
node.id can be any string
Opaque node ids are represented by raw byte arrays. In this case node.id must be the base64 encoding of the node id.
node.id must be a string conforming to the format described in the documentation of the java.util.UUID.toString() method.
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.
This procedure can put under stress the gateway and the server if the target folder contains a lot of children nodes.
In order to configure the driver to perform the discovery operation, a single channel can be defined with the following configuration:
- 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
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.
The driver will consider as folders to visit all nodes that whose type definition is
FolderType, that is all nodes with the following reference:
- namespace index: 0
- node id: 61 (numeric)
The driver will subscribe to all variable nodes found.
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.
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.
Updated 5 months ago