OPC-UA Events

Table 1.
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.

Table 2.
FieldTypeRequiredDefault
transport_addrStringYes
event_nodeArrayYes
event_attributesArrayYes
log_levelStringNo'off'
log_nameStringNo<block_name>
interval [milliseconds]IntegerNo1000
optionsStringNo
The 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"]
      }
}
The following is an example JSON output event (line formatted for simple display) from alias “Server-Prosys” and attributes “Message” and “Severity”:
{"data": {
     "Server-Prosys.Message":{"type":"string","val":"Level exceeded"},
     "Server-Prosys.Severity":{"type":"uint16","val":500}
    },
 "timestamp":1551250457139}
}