OPC-UA Poll Flat

Table 1.
Type
'opcuapollflat'

OPC-UA Poll flat also requires an additional field: interval.

The OPC-UA Poll Flat adapter block is used to poll a number of OPC-UA Variable nodes to retrieve their data at a specified polling interval and convert that data to flat JSON or Predix Timeseries format.

The following table details the fields of this block's config object. For details on what any common fields mean, see Configuration Properties for OPC-UA Protocol Adapter.
Table 2.
FieldTypeRequiredDefault
transport_addrStringyes
data_mapArrayyes
intervalIntegeryes
log_levelString'off'
log_nameString
optionsObject
report_bad_qualityBooleanfalse
source_timestampBooleantrue
output_formatString'flat_json'
The data_map field is an array that contains objects with two fields: alias and id.
  • The alias field gives that node an alias to be used in the flat JSON output data. This alias 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 determines the Node ID of the node on the OPC-UA server.

interval

The interval field determines the interval (in milliseconds) at which the block will poll its endpoint for data. For example, if this is set to 1000, the block will attempt to get data every second.

report_bad_quality

When set to 'true', the report_bad_quality field is used to send bad quality data about the polled tags to the timeseries when connectivity to the OPC UA server is lost. The value of the tags would be set to 'NULL' and the data is sent to the timeseries at every polling interval. When connectivity is restored, normal data is sent again. If this field is set to 'false', then no data would be sent to the timeseries when connectivity to the OPC UA server is lost.

source_timestamp

When set to 'true', the source_timestamp field uses the timestamp of the data from the OPC UA server. If it is set to 'false', the timestamp from the Predix EDGE device is used. The caveat here is that report_bad_quality takes precedence. When report_bad_quality is set to 'true', the source_timestamp field is internally forced to 'false', regardless of the value set by the user. The value of the source_timestamp field set by the user is honoured only when report_bad_quality is set to 'false'.

output_format

The output_format field takes a string parameter and can be either flat_json or time_series.

Example Config Block

"opcua_input": {
    "type": "opcuapollflat",
    "config": {
        "transport_addr": "opc-tcp://<OPCUA_HOST>:<OPCUA_PORT>",
        "log_level": "debug",
        "interval": 1000,
        "report_bad_quality": false,
        "source_timestamp": false,
        "output_format": "flat_json",
        "options": {
            "username": "user",
            "password": "pass",
            "client_cert_path": "/config/client.der",
            "client_private_key_path": "/config/keys/client.key"
        },
        "data_map": [
            {
                "alias": "SampleValue",
                "id": "ns=1;s=SampleValue"
            }
        ]
    }
}