This Collector Plugin provides options to connect and subscribe to tags configured in a OPC UA Server.
Example 1 - Multiple Topics in One Subscription
Example 2 - Multiple Subscriptions
Introduction
The Collector configuration file appconfig.json
for Windows, or appconfig.Docker.json
for Docker, contains the Settings
definition to connect to a OPCUA Server, to subscribe to tags, and to interpret the messages received from those subscriptions.
By default this file can be found within C:\Program Files\Flow Software\Timebase\Collector\
for Windows, or /config
for Docker.
Multiple Topics in One Subscription
The OPC UA collectors use a principle of adding tags to a subscription based on a defined tag pattern, rather than selecting individual tags to subscribe to. These are calledTopics
. Topics can be an array of patterns to use to match tags in the OPC UA Server.
Any tags matching the topic structure will be added automatically. In this example, all tags prefixed with either Timebase Load Test.PLC 01.000000
or Timebase Load Test.PLC 01.100000
will be added to the subscription:
{
"Historians": [
{
"Host": "<HistorianHostOrIPAddress>",
"Port": 4511,
"UseTls": false
}
],
"Active": true,
"Type": "OPCUA",
"Dataset": "OPC UA Data",
"Settings": {
"Url": "opc.tcp://<OPCUAHostOrIPAddress>:<OPCUAServerPort>",
"Subscriptions": [
{
"Interval": 100,
"Topics": [
"Timebase Load Test.PLC 01.000000.#",
"Timebase Load Test.PLC 01.100000.#"
]
}
]
}
}
Multiple Subscriptions
One can add multiple subscriptions with multiple Topics
and Intervals
The config below will create 2 subscriptions to the OPC UA Server with an interval of 100ms and 1000ms each. Each subscription has 2 different topic patterns defined to match tags on to add to the subscriptions.
"Settings":
{
"Url": "opc.tcp://<OPCUAHostOrIPAddress>:<OPCUAServerPort>",
"Subscriptions": [
{
"Interval": 100,
"Topics": [
"Timebase Load Test.PLC 01.000000.#",
"Timebase Load Test.PLC 01.100000.#"
]
},
{
"Interval": 1000,
"Topics": [
"Timebase Load Test.PLC 01.200000.#",
"Timebase Load Test.PLC 01.300000.#"
]
}
],
}
Settings
The following settings can be set for the OPC UA plugin:
Connection
Url
string
required
The fully qualified url for the OPCUA server (e.g. opc.tcp://opcua.demo-this.com:58810)SessionTimeout int
Timeout of the OPCUA session (ms). Default value is 60000.KeepAlivePeriod
int
Interval between periodic signals sent to the OPCUA server to confirm it is reachable (ms). Default value is 10000.ReconnectPeriodMaximum
int
Maximum interval between periodic attempts to reconnect to the OPCUA server (ms). Reconnection attempts will start immediately, but then exponentially backoff until this maximum period is reached. Default value is 15000.
Authentication
Username
string
The username required to authenticate with the OPC UA ServerPassword
string
The password required to authenticate with the OPC UA Server. If aUsername
is provided, then aPassword
must also be provided.
Security
SecurityPolicy
string
Defines the encryption and hashing algorithm used to secure OPC UA communications. Options includeNone
,Basic256
,Basic128Rsa15
,Basic256Sha256
,Aes128Sha256RsaOaep
, orAes256Sha256RsaPss
. Default value isNone
.SecurityMode
string
Defines how the security policy is applied to message exchanges. Options includeNone
,Sign
, orSignAndEncrypt
. Default value isNone
.
Certificate Management
ApplicationSubjectName
string
Used to uniquely identify the client application (CN=Common Name, O=Organization, OU=Department, C=Country, DC=Domain Component)ApplicationStorePath
string
Specifies the directory where an application's certificates and private keys are storedTrustedIssuerStorePath
string
Specifies the directory that stores certificates from trusted Certificate AuthoritiesTrustedPeerStorePath
string
Specifies the directory that contains certificates of other trusted OPC UA clients and serversRejectedStorePath
string
Specifies the directory where certificates are placed if they are not trusted or do not pass validation checksAutoAcceptUntrusted
bool
Allows automatic acceptance of untrusted certificates. Default value istrue
.
Subscriptions
Subscriptions
array ofSubscription
required
Subscriptions
Interval
Interval
int
This represents the cyclic rate at which the subscription executes and attempts to send a NotificationMessage to the client
Topics
Topics
array ofstring
Topics are case-sensitive and composed of one or more levels, separated by a dot ("."). "+" represents a single-level wildcard (e.g. "rooms.+.temperature"). ."#" represents a multi-level wildcard that can only be used as the last character in the topic, preceded by a dot (e.g. "rooms.#").Filter
string
A tag filter is case-sensitive regex string applied to the resultant tagnames (e.g. "Line 1|.*RPM$" will exclude any tagname that contains "Line 1" or ends with "RPM". The regex string can be used to specify multiple filters where required.