The OPC UA Collector Plugin
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
OPC UA Collector with Ignition
Introduction
The Collector config provides a front end editor for the OPC UA Collector. By default, this is found at localhost:4521 or the appropriate port number if you have multiple Collectors.
Select the Config tab.
This quick 5 minute video will cover the basics of setting up your OPC UA logging session.
Modifying data from within the config tool will effect multiple config files, all located within C:\Program Data\Flow Software\Timebase\Collector\Config for Windows, or /config for Docker.
Changing the Data Source Type or Targeted Historian will write to collector.config, adding or modifying the Target Historians will write to historians.config, and using the Settings window and editing the JSON object to define how to connect to an OPCUA Server, to subscribe to tags, and to interpret the messages received from those subscriptions will modify the settings.config file.
Multiple Topics in One Subscription
Tags are added to an OPC UA logging session via a subscription. A single subscription should be less than 10,000 tags, and multiple subscriptions are allowed. Each subscription is built based on a defined tag pattern, rather than hand-selecting individual tags.
These patters are called Topics and can be a single pattern or an array of patterns to match the 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:
{
"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 & Security
The following settings can be set for the OPC UA plugin:
Connection
UrlstringrequiredThe fully qualified url for the OPCUA server (e.g. opc.tcp://opcua.demo-this.com:58810)SessionTimeout intTimeout of the OPCUA session (ms). Default value is 60000.KeepAlivePeriodintInterval between periodic signals sent to the OPCUA server to confirm it is reachable (ms). Default value is 10000.ReconnectPeriodMaximumintMaximum 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.BrowseIntervalintRefresh Interval for Browsing the OPCUA Server for new Nodes. Defines the frequency (in minutes) at which the OPC UA server's namespace is browsed for new nodes. A lower value results in more frequent checks and faster updates, while a higher value reduces network traffic at the expense of update latency. The default is 30 minutes.
It may be helpful to watch this demonstration of how the security and authentication settings are configured as well as the error messages that you may experience while dialing in these settings.
Security and Authentication Settings video:
Authentication
UsernamestringThe username required to authenticate with the OPC UA ServerPasswordstringThe password required to authenticate with the OPC UA Server. If aUsernameis provided, then aPasswordmust also be provided.
Security
SecurityPolicystringDefines the encryption and hashing algorithm used to secure OPC UA communications. Options includeNone,Basic256,Basic128Rsa15,Basic256Sha256,Aes128Sha256RsaOaep, orAes256Sha256RsaPss. Default value isNone.SecurityModestringDefines how the security policy is applied to message exchanges. Options includeNone,Sign, orSignAndEncrypt. Default value isNone.
Certificate Management
ApplicationSubjectNamestringUsed to uniquely identify the client application (CN=Common Name, O=Organization, OU=Department, C=Country, DC=Domain Component)ApplicationStorePathstringSpecifies the directory where an application's certificates and private keys are storedTrustedIssuerStorePathstringSpecifies the directory that stores certificates from trusted Certificate AuthoritiesTrustedPeerStorePathstringSpecifies the directory that contains certificates of other trusted OPC UA clients and serversRejectedStorePathstringSpecifies the directory where certificates are placed if they are not trusted or do not pass validation checksAutoAcceptUntrustedboolAllows automatic acceptance of untrusted certificates. Default value istrue.
Subscriptions
Subscriptionsarray ofSubscriptionrequired
OPC UA Collector with Ignition Video:
Here are a couple of articles that we found helpful from our friends at Ignition:
Subscriptions
Interval
IntervalintThis represents the cyclic rate at which the subscription executes and attempts to send a NotificationMessage to the client
Tagname Prefix
TagnamePrefixstringA constant string to be prepended to the node name for uniqueness in this subscription. If left empty, the node name is used as is. This is useful if multiple identical pieces of equipment need to write data to a dataset. A tag prefix would then ensure uniqueness in tag names when created.
Topic Definition
TopicDefinitionstringA dot-delimited string describing the semantic keys for each topic segment (e.g.enterprise.site.area.machine). Topic segments beyond those defined here will be ignored.- These segments can be used to add dynamic fields to your tags based on the values of these keys in your Topic structure. Looking at our example topic of
ACME.Austin.Packaging.Capper1,enterprisewill resolve to "ACME", area to "Packaging" andmachineto "Capper1". - These fields can be added to your tag definition using the
Fieldsproperty defined below.
Fields
Fields are metadata key/value pairs applied to all tags in this subscription. Defining these key/value pairs will add Fields to tags in the dataset, allowing metadata to be extracted directly from your source systems where available. Fields are useful to classify, group, and filter tags based on attributes like enterprise, site, area, machine or device associated to the tag.
Static Fields
Fields can be defined a static text:
"Fields": {
"Enterprise": "ACME",
"Site": "Austin",
"Area": "Packaging"
}
Topic Fields
Together with the TopicDefinition configuration above, fields can be defined to extract values from the topic structure:
"Fields": {
"Enterprise": "[Topic:enterprise]",
"Site": "[Topic:site]",
"Area": "[Topic:area]",
"Machine": "[Topic:Machine]"
}
Combinations of field definition types can be used to create valuable tag metadata:
"Fields": {
"Id": "Id-[Topic:area][Topic:machine]"
}
Topics
Configure your subscriptions to have less than 10,000 tags per subscription. Multiple subscriptions are allowed.
Topicsarray ofstringTopics 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.#").FilterstringA 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.
If using an escape character \ in your regex, you must use a double escape \\ since the regex is contained within a JSON object.