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 

Settings

Subscriptions


 

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

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:

{
"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 Server
  • Password string The password required to authenticate with the OPC UA Server. If a Username is provided, then a Password must also be provided.

Security

  • SecurityPolicy string Defines the encryption and hashing algorithm used to secure OPC UA communications. Options include None, Basic256, Basic128Rsa15, Basic256Sha256, Aes128Sha256RsaOaep, or Aes256Sha256RsaPss. Default value is None.
  • SecurityMode string Defines how the security policy is applied to message exchanges. Options include None, Sign, or SignAndEncrypt . Default value is None.

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 stored
  • TrustedIssuerStorePath string Specifies the directory that stores certificates from trusted Certificate Authorities
  • TrustedPeerStorePath string Specifies the directory that contains certificates of other trusted OPC UA clients and servers
  • RejectedStorePath string Specifies the directory where certificates are placed if they are not trusted or do not pass validation checks
  • AutoAcceptUntrusted bool Allows automatic acceptance of untrusted certificates. Default value is true.

Subscriptions

  • Subscriptions array of Subscription required

Subscriptions

Interval

  • Interval intThis represents the cyclic rate at which the subscription executes and attempts to send a NotificationMessage to the client

Topics

  • Topics array of string 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.

If using an escape character \ in your regex, you must use a double escape \\ since the regex is contained within a JSON object.