Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

Code Block
<?xml version="1.0" encoding="utf-8" ?>
<OpcUaConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:schemaLocation="https://senseforce.io/ ..\..\Schemas\opcuasettings.xsd">
  <SessionName>Senseforce Luna OPC UA Client</SessionName>
  <EndpointUrl>opc.tcp://desktop-7ql4vn4:51210/UA/SampleServer</EndpointUrl>

  <!-- Defines the maximum security level to connect with -->
  <MaxSecurityMode>SignAndEncrypt</MaxSecurityMode>

  <!--<UserName>Senseforce</UserName>
  <Password>PW1</Password>-->

  <PreferredLocales>
    <Locale>en-EN</Locale>
  </PreferredLocales>

  <SessionTimeout>700000</SessionTimeout>

  <!-- Regex which is used to extract variable name from StartNodeId -->
  <!-- <VariableNameRegex> myregex </VariableNameRegex> -->

        <!-- Regex which is used to extract a new Datapoint called NodeIdRegex    The NodeId is used to create the value by specifying a regex. -->

  <!-- <NodeIdRegex> myRegex </NodeIdRegex> -->

        <!-- Set path and file name of the opc application configuration file -->

  <ApplicationConfig>
    <FilePath>$(LunaAppDataPath)configurations/InputPlugins/OPCUA</FilePath>
    <FileName>opcapplicationconfiguration.xml</FileName>
  </ApplicationConfig>
  	<!-- Set path and file name of the opc subscriptions configuration file -->
  <Subscriptions>
    <FilePath>$(LunaAppDataPath)configurations/InputPlugins/OPCUA</FilePath>
    <FileName>opcsubscriptions.xml</FileName>
  </Subscriptions>
  	<!-- Set path and file name of the opc mapping file -->
  <Mappings>
    <FilePath>$(LunaAppDataPath)configurations/InputPlugins/OPCUA</FilePath>
    <FileName>DataMappings.xml</FileName>
  </Mappings>
  <Logger>
    <!--LogLevel: Debug,Information,Warning,Error,Critical,None-->
    <LogLevel>Information</LogLevel>
  </Logger>
</OpcUaConfiguration>

...

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.

...

Code Block
<Filter i:type="DataChangeFilter">
  <Trigger>StatusValue_1</Trigger>
  <DeadbandType>1</DeadbandType>
  <DeadbandValue>1</DeadbandValue>
</Filter>

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 browser

Aggregations

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 Node-Identifier of a monitored item, not the DisplayName. Refer to your subscription.xml to check your NodeIdentifiers.

(Annotation: If you have an Identifier like ns=2;i=10854, the Node-Identifier and therefore DataPointNmae is 10854!

AggregatorTypes

Add one <Type></Type> line for each aggregation type you want to configure. Allowed types are Average, StandardDeviation, Maximumand Minimum.

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 SamplingInterval setting in your subscription.xml (see section Subscription creation)