OPC UA Trigger Node
The OPC UA Trigger Node will trigger a workflow whenever an Edge Compute Device receives a change message on the configured OPC UA monitored node.
Node Properties
There are five main parts of the properties for this node …
Configuration
Configuration Type: Select whether to configure this trigger using the individual fields available in the sections below, or by pulling a named configuration from your Gateway Edge Agent’s config file.
This feature is only available in Gateway Edge Agent Version 1.40.0 and higher.
The two options are:
- Individual Fields (Default): Fields are individually set within the node properties.
- Agent Config File: Pull a named configuration from your Gateway Edge Agent’s config file.
In the case of the Agent Config File, there are required fields similar to the fields described below: uri, and at least one monitoredItems. The type opcua
and a unique name field are also required.
Example (including all field names):
[[triggers]]
name = 'myTriggerName'
type = 'opcua'
uri = 'opc.tcp://localhost:4335/UA/Server'
username = 'me'
password = 'pass'
securityPolicy = 'Basic256' # e.g. Basic124, ...
securityMode = 'SIGNANDENCRYPT' # or SIGN
cert = '-----BEGIN CERTIFICATE----- ...'
privateKey = '-----BEGIN RSA KEY----- ...'
samplingInterval = '60' # ms
eventFilter = ['Values']
[[triggers.monitoredItems]]
nameSpace = 1
identifier = 'i=2254'
[[triggers.monitoredItems]]
identifier = 's=myNode'
Connection Configuration
Connection Configuration contains:
- OPC UA URI: (Required) A string template for the OPC UA server URI.
- Username: (Optional) A string template for login username.
- Password: (Optional) A string template for login password.
Security Settings
You can optionally select a SSL/TLS “Security Policy” for the connection to the OPC UA server through the dropdown selector. Security Policy options include:
- None
- Basic-128
- Basic-128 RSA-15
- Basic-192
- Basic-192 RSA-15
- Basic-256
- Basic-256 SHA-256
If a Security Policy is selected, you will have the option to select between “Sign” or “Sign and Encrypt” security modes. You’ll then be required to provide a valid SSL/TLS client certificate and private key.
Monitor Instructions
You are required to monitor a single OPC UA node for the OPC UA: Trigger Node. Each instruction has the following fields:
- Sampling Interval (Required): A positive integer of time between samples measured in milliseconds.
- Namespace Index (ns) (Required): A positive integer.
-
Identifier (Required): A string for the node identifier. The identifier string should begin with one of the following types:
- i=: for unsigned integer (UINT).
- s=: for string.
- g=: for global unique identifier (GUID).
- b=: for byte string.
Event Filters
Optionally, you can filter multiple OPC UA events and alarms to trigger and display in the payload. You can include custom event/alarm types or select from common OPC UA events. If no event filter is selected, a value change on a node object will be the only event triggered and displayed in the payload.
Note: OPC UA “Extension Objects” returned on an event are not currently supported.
Example Payload
The payload will include the triggering datagram data
field. If you are monitoring specific events or alarms, from the Event Filters
config, they will be displayed in an object under the data
field:
{
"applicationId": <id of the current application>,
"applicationName": <name of the current application>,
"data": {
"Message": "Condition value is 0.7286692235894777 and state is High",
"HighLimit": 0.9,
"EventType": "ns=0;i=9341"
},
"deviceId": <id of the edge device>,
"deviceName": <the edge device name>,
"deviceTags": {<any tags for the edge device>},
"flowId": <id of the current workflow>,
"flowName": <name of the current workflow>,
"flowVersion": <name of the current workflow version>,
"globals": <object of workflow globals>,
"isConnectedToLosant": <if the agent is connected to Losant>,
"agentEnvironment": <object of environment variables>,
"time": <time the message arrived>,
"triggerId": <id of the opcua trigger>,
"triggerType": "opcua"
}
If no event filter is configured the new value will appear at the data
field:
{
"applicationId": <id of the current application>,
"applicationName": <name of the current application>,
"data": "new value",
"deviceId": <id of the edge device>,
"deviceName": <the edge device name>,
"deviceTags": {<any tags for the edge device>},
"flowId": <id of the current workflow>,
"flowName": <name of the current workflow>,
"flowVersion": <name of the current workflow version>,
"globals": <object of workflow globals>,
"isConnectedToLosant": <if the agent is connected to Losant>,
"agentEnvironment": <object of environment variables>,
"time": <time the message arrived>,
"triggerId": <id of the opcua trigger>,
"triggerType": "opcua"
}
Related Nodes
Was this page helpful?
Still looking for help? You can also search the Losant Forums or submit your question there.