OPC-UA Events
Type |
---|
'opcuaevent' |
The OPC-UA Event adapter block is used to subscribe to an OPC-UA event node to receive base event notifications and convert them into JSON format. The following table details the fields of this block’s config object. For details on what any common field means, see Configuration Properties of OPC-UA Protocol Adapter.
Field | Type | Required | Default |
---|---|---|---|
transport_addr | String | Yes | |
event_node | Array | Yes | |
event_attributes | Array | Yes | |
log_level | String | No | 'off' |
log_name | String | No | <block_name> |
interval [milliseconds] | Integer | No | 1000 |
options | String | No |
event_node
field is an array with one single entry. The entry contains two fields: alias
and id
:- The
alias
field assigns that node an alias to be used in the flat JSON output data. The alias is prepended to the event attribute name and becomes the Time Series Tag if the data is converted to Time Series Format using the Flat to Time Series conversion block. - The
id
field specifies the Node ID of the node on the OPC-UA server. The standard node ID for events defined by OPC is “ns=0;i=2253”.
The OPC-UA defined base event attributes are: "SourceNode", "SourceName", "Time", "EventId", "EventType", "LocalTime", "Message", "ReceiveTime", "Severity".
Note that the event attributes are case sensitive. Undefined names or duplicates are silently discarded.
The interval
defines the retransmission interval for subscription requests from the client after connection to the OPC-UA server has been established.
Example Config Block
"opcua": {
"type": "opcuaevent",
"config": {
"transport_addr": "opc-tcp://<OPCUA_HOST>:<OPCUA_PORT>",
"log_level": "debug",
"event_node": [
{
"alias": "Server-Prosys",
"id": "ns=0;i=2253"
}
],
"event_attributes": ["SourceNode", "SourceName", "Time",
"EventId", "EventType", "LocalTime",
"Message", "ReceiveTime", "Severity"]
}
}
{"data": {
"Server-Prosys.Message":{"type":"string","val":"Level exceeded"},
"Server-Prosys.Severity":{"type":"uint16","val":500}
},
"timestamp":1551250457139}
}