🚧OPC UA (WIP)

OPC Unified Architecture (OPC UA) is a platform-independent, service-oriented architecture that integrates diverse industrial automation systems. It provides a robust, secure, and scalable framework for connecting devices and transmitting data across various platforms. OPC UA's ability to standardise communication and ensure interoperability makes it an essential protocol connector in modern industrial environments.

Here is a practical example of how OPC UA can be used as a protocol in factory automation:

  • An OPC UA server is installed on a central controller.

  • Various production machines, equipped with OPC UA-enabled sensors and actuators, connect to the server.

  • A manufacturing execution system (MES) acting as an OPC UA client retrieves machine statuses and production data for real-time monitoring and control. The OPC UA client in our case can be a machine with an edge-connector on it.

Functions

create

Constructs an OPC UA client instance.

Parameter
Type
Default
Description

securityMode

'None'

One from 'unauthorized', 'None', 'Sign' or 'SignAndEncrypt'.

securityPolicy

'None'

One from 'Aes128_Sha256_RsaOaep', 'Basic128', 'Basic192', 'Basic192Rsa15', 'Basic256Sha256', 'Basic256Rsa15', 'Basic256Rsa15', 'unauthorized', 'None', 'PubSub_Aes128_CTR' or 'PubSub_Aes256_CTR'.

certificateFile

String

privateKeyFile

String

listenToEvents

Reports about relevant events. You can use the listener box to connect a function to run on events.

connect

Connects to an OPC UA server.

Parameter
Type
Default
Description

endpointUrl

String

userIdentity

Object

Object that contains user identity information. All following parameters must be part of this object if utilised.

userIdentity.

username

String

userIdentity.

password

String

userIdentity.

userCertificate

String

userIdentity.

userCertificate

PrivateKey

String

disconnect

browse

Detailed browsing of the given browse path (non-recursive).

You can use the parameter address to navigate to the desired folder. The function shows the contents of the root folder as default. You can also specify the session with sessionId.

readNode

Reads a variable.

Use parameter address for the node ID or a valid browse path. You can also specify the session with sessionId.

readVariableValue

Reads the value of a variable.

Use parameter address for the node ID or a valid browse path. You can also specify the session with sessionId.

monitorNode

Starts monitoring an item.

Parameter
Type
Default
Description

address

String

Node ID or a valid browse path.

listener

Function

The connected function is automatically called upon time change.

options

Object

The options object can contain all the following parameters.

options.

sampling

Interval

Integer

1000

The sampling interval in milliseconds.

options.

queueSize

Integer

100

The maximum queue size.

options.

discard

Oldest

Boolean

true

Sets the policy for when the queue is full. Decides whether to discard the oldest or newest entries. Default discards the oldest entries.

options.

subscriptionId

String

monitorValue

Starts monitoring an item value.

Parameter
Type
Default
Description

address

String

Node ID or a valid browse path.

listener

Function

The connected function is automatically called upon time change.

options

Object

The options object can contain all the following parameters.

options.

sampling

Interval

Integer

1000

The sampling interval in milliseconds.

options.

queueSize

Integer

100

The maximum queue size.

options.

discard

Oldest

Boolean

true

Sets the policy for when the queue is full. Decides whether to discard the oldest or newest entries. Default discards the oldest entries.

options.

subscriptionId

String

stopMonitor

Stops monitoring an item. Use the parameter nodeId to specify what to stop monitoring.

writeNode

Does nothing at the moment.

createSession

Creates a session.

closeSession

Closes the session and all associated subscriptions. Use the parameter sessionId to specify which session to close.

createSubscription

Creates a subscription.

Parameter
Type
Default
Description

sessionId

String

options

Object

options.

maxNotifications

PerPublish

Integer

0

The maximum amount of notifications per time publishing.

options.

priority

Integer

The subscription priority from 0 to 255

options.

publishing

Enabled

Boolean

true

Enable or disable publishing.

options.

requestedLifetime

Count

Integer

options.

requestedMax

KeepAliveCount

Integer

10

options.

requested

PublishingInterval

Integer

1000

Interval in milliseconds for publishing.

Last updated

#284:

Change request updated