OPC UA Plugin
The OPC UA plugin integrates two OPC UA specifications: Data Access and Alarms and Conditions.
Configuration location:
These configs are only used for the Edge instance Luna.Console, executed directly from the [Edge Main Folder]. Click the "Service Application" tab above to check the location for Edge services.
Use the default DataMappings.xml and opcapplicationconfiguration.xml for most use cases. The default DataMappings.xml generate the following OPC UA Data Variables which can be used in the EventDefinition.xml
DisplayName: Name of the OPC UA item
SubscriptionName: Name of the OPC UA subscription, the item was assigned to
StatusCode: OPC UA Status Code of the item
Data: Data value of the OPC UA item
DataType: Translated data-type of the OPC UA item (.net datatype, not opc ua type)
SourceTimestamp: Timestamp when the source notified a change in value
ServerTimestamp: Timestamp when the Server recognized the change in value
StartNodeId: Node-Id of the item
If using the OPC UA Aggregations:
[DisplayName]Average, [DisplayName]Maximum, [DisplayName]Minimum, [DisplayName]StandardDeviation: If using the OPC UA Aggregation feature, these data points are moving aggregations according to the aggregation configuration. The DisplayName of the item is prepended to the aggregation type.
OpcUaSettings.xml
The OpcUaSettings.xml contains general information required for both Data Access as well as Alarms and Conditions.
Example configuration
Setting | Description |
SessionName | Name of the OPC UA session. Just for informational purposes |
EndpointUrl | Defines where to find the OPC UA server. Use the fully qualified OPC UA server endpoint URL |
Advanced settings
Setting | Description |
MaxSecurityMode | By default SF Edge uses the maximum security mode available at the OPC UA server. Optionally degrade the security setting. Allowed values: SignAndEncrypt, Sign, None |
Username / Password | Optional user credentials for authenticating SF Edge at the server |
PreferredLocales | Optional. If subscriptions to textual nodes are established, use this setting to set which localization should be used. |
SessionTimeout | Timeout of the OPC UA session. |
VariableNameRegex | Regex which is used to extract variable name from OPC UA server's StartNodeId |
NodeIdRegex | Regex, used to create a new datapoint called NodeIdRegex. The OPC UA server NodeId is used to create the value by matching this regex. |
OPC UA Certificate handling
To establish a secure connection between SF Edge and the OPC UA server, the SF Edge certificates as well as the OPC UA server certificate need to be exchanged
Copy public Senseforce Edge certificate (the public .der -file in the certs/certs - folder) to the OPC UA Server's trusted certificate folder
Default OPC UA server trusted certificate folder is in [CommonApplicationData]/OPC Foundation/CertificateStores/UA Applications/certs (on the OPC UA server computer)
CommonApplicationData for Windows: C:/ProgramData
CommonApplicationData for unix: /usr/share (or the assemblies runtime location)
Copy the the OPC UA Server certificate to the SF EOPC UA trusted certificate folder. (Configured in the SF Edge opcapplicationconfiguration.xml file)
Default folder: CommonApplicationData/OPC Foundation/CertificateStores/UA Applications/certs
Default behavior to get the server certificate:
Start SF Edge with OPC UA Plugin (and therefore try to connect to the server)
SF Edge will automatically place the server certificate in the rejected certificates folder (configured in the SF Edge opcapplicationconfiguration.xml file - default: [CommonApplicationData]/OPC Foundation/CertificateStores/RejectedCertificates/certs).
Manually copy the server certificate from Rejected to Trusted folder
Subscription creation
To finally connect to the OPC UA server and subscribe to server nodes, the opcuasubscriptions.xml file needs to be configured. Use the Senseforce OPC UA server browser to create subscriptions for either OPC UA Data Access or Alarms and Conditions.
Exemplary opcuasubscriptions.xml are found below
Data Access
The belows example subscription subscribes to two Monitored items by defining two MonitoredItem blocks (see line 29 to 44 and 45 to 60). The most relevant settings are:
Setting | Descriptions |
Identifier (line 32) | Defines the OPC UA node address - to be found in the OPC UA Server definition or by using a OPC UA Data Access client. |
SamplingInterval (line 40) | Set the server-side sampling interval of the data point. Set to 0 for "as fast as possible" or -1 for "as fast as publishing interval". In milliseconds. |
To add another node id to the subscription, simply copy/paste a full MonitoredItem (eg. lines 29 to 44) and change the Identifier as described above.
Setting OPC UA hysteresis filters
OPC UA implements powerful hysteresis filter settings. To add a filter to a specific monitored item, simply replace the section "<Filter i:nil="true" />" with
Setting | Description |
DeadbandValue | any absolute hysteresis value (eg. changing DeadbandValue to 10 means only values which changed by at least 10 compared to previous values are recognized) |
Alarms and Conditions
Use the Senseforce OPC UA Data Access browser to create an opcuasubscriptions.xml file. Replace the original file with the newly created one.
OPC UA server browserAggregations
Use the Aggregations.xml file to define moving aggregations for one or several of your variables.
Use one AggregatedValue
Block per variable you want to aggregate.
Add the following settings to each block:
Setting | Description |
DataPointName | Name of the OPC UA item to aggregate. Note: The name identifies the (Annotation: If you have an Identifier like |
AggregatorTypes | Add one You can define several types for one variable (but only one for each type of aggregation). |
WindowSizeNumber | The aggregations are implemented using moving statistics - meaning, always a moving window of aggregations is calculated. The WindowSizeNumber defines how many samples are used for one aggregation cycle. Refer to the |
Last updated