Skip to main content

OPC UA Brownfield Mapping

The OPC UA Brownfield Mapping allows you to define how data from external OPC UA servers is mapped to the Sterfive OPCUA Omni Edge Server's data model. This is particularly useful for integrating legacy systems or third-party devices into a unified data model.

There are 3 main types of mappings you can define:

  • binding: Creates a direct link between a variable in the external OPC UA server and a variable in the Sterfive OPCUA Omni Edge Server.
  • copy: Copies a UAVariable of the external OPC UA server as a child of the destination node in the Sterfive OPCUA Omni Edge Server.
  • replicate: Replicates an entire node sub-tree from the external OPC UA server to the Sterfive OPCUA Omni Edge Server, including all its attributes and child nodes.

Mapping at the connection level

You can also map the OPC UA connection to a specific data model by using the mapping property in the connection configuration. This allows you to define how the data from the OPC UA server should be represented in the Sterfive OPCUA Omni Edge Server.

brownfieldDevices:
opcuaConnections:
- name: S1
endpointUrl: opc.tcp://opcuademo.sterfive.com:26541
mapping:
- source:
destination:
type:

Example Configuration

brownfieldDevices:
opcuaConnections:
- name: S1
endpointUrl: opc.tcp://opcuademo.sterfive.com:26541
mapping:
- source: /di:DeviceSet/1:CoffeeMachineA/cke:Parameters/cke:BoilerTempWater
destination: /1:ProcessValues/1:BoundVariable
samplingInterval: 1000
type: binding
- source: /di:DeviceSet/1:CoffeeMachineA
destination: /di:DeviceSet
type: replicat
- source: /di:DeviceSet/1:CoffeeMachineA/cke:Parameters/cke:BoilerTempWater
destination: /1:ProcessValues
type: copy

Mapping at the mapping level

Alternatively, you can define OPCUA mappings in the mappings section of your configuration file. This might be more usefull to keep all your mappings in a single place, especially if you have multiple connections or complex mappings.

brownfieldDevices:
opcuaConnections:
- name: S1
endpointUrl: opc.tcp://opcuademo.sterfive.com:26541
mappings:
- opcua: S4
source:
destination:
type:

mapping parameters

  • source: The source node in the OPC UA server to bind.
  • destination: The destination node in the Sterfive OPCUA Omni Edge Server where the data will be bound.
  • samplingInterval: (Optional) The interval at which the data will be sampled from the source node.
  • type: The type of mapping to be applied (e.g., binding, replicate, copy) (see below for details).

source

  • The source node in the OPC UA server to bind. (could be a node Id or better a node path). Remember that the source should be expressed in the context of the remote OPC UA server.
  • To avoid namespaceIndex issues, it is recommended to use Aliased Browse Path the node path (e.g., /di:DeviceSet/1:CoffeeMachineA/cke:Parameters/cke:BoilerTempWater). instead of the node Id (e.g., ns=2;i=1234) or standard path (e.g., ns=2;s=CoffeeMachineA/14:Parameters/14:BoilerTempWater).

Note: Since the configuration maintain a alias list of namespaceUri and all namespaces of the remote OPC UA server are imported into the Sterfive OPCUA Omni Edge Server, you can use the same Aliased browse path to avoid namespaceIndex issues when converting from the local namespace of the omni-edge-server to the remote OPC UA server namespace.

destination

  • The destination node in the Sterfive OPCUA Omni Edge Server where the data will be bound. (could be a node Id or better a node path). The destination should be expressed in the context of the Sterfive OPCUA Omni Edge Server.

samplingInterval

(Optional) The interval at which the data will be sampled from the source node. If not specified, the default sampling interval will be used.

type

The type of mapping to be applied must be binding copy or replicate and termining the behavior of the mapping operation

mapping types

binding

  • The binding mapping type is used to bind a variable from the remote OPC UA server onto an existing variable in the Sterfive OPCUA Omni Edge Server. This allows you to create a direct link between the two variables, enabling real-time data exchange.
  • This mean that the destionation variable value will be automatically updated with the value of the source variable in the remote OPC UA server.
  • The destination variable must already exist in the Sterfive OPCUA Omni Edge Server data model before the mapping is made.
  • The destination variable shall not need to have exactly the same data type as the source variable, but it should be compatible. For example, if the source variable is a Double, the destination variable can be a Float or Integer, but not a String or Boolean.
  • The destination variable will be updated with the value of the source variable at the specified sampling interval.
  • The source variable shall be of node class Variable. The destination variable be of node class Variable too.
example:
- source: /di:DeviceSet/1:CoffeeMachineA/cke:Parameters/cke:BoilerTempWater
destination: /1:ProcessValues/1:BoundVariable
samplingInterval: 1000
type: binding
  • In this example, the binding mapping type is used to bind the variable BoilerTempWater of the remote server onto the BoundVariable in the Sterfive OPCUA Omni Edge Server.
  • The BoundVariable is supposed to exist in the Sterfive OPCUA Omni Edge Server data model prior to the mapping is made. Refer to the chapter on how to create new variables in the Sterfive OPCUA Omni Edge Server data model.
  • The data will be sampled from the source variable every 1000 milliseconds (1 second) and the value will be updated in the BoundVariable of the Sterfive OPCUA Omni Edge Server.

copy

  • The copy mapping type is used to bind a variable from the remote OPC UA server onto a variable that will be created into the Sterfive OPCUA Omni Edge Server.
  • The destination variable must be a Object that will be the parent of the newly created variable
  • The created variable will have the same DataType as the original variable
  • Only basic DataType are supported. if you want to replicate a complex DataType, you should use the replicate mapping type instead.

aggregate

Notes

Ensuring that you have all required Type namespace

In case you want to use the aggregate capabilities above, you need to ensure that the OPC UA edge server you are builing has all the required type namespace of the remote server you want to connect to.

You can achieve this by importing the necessary type definitions into the Sterfive OPCUA Omni Edge Server under the nodesets: configuration.

This should be straightforward if the Nodeset2.xml refers to standard OPC UA Compnion specifications or other well-known types.

However, if the Nodeset2.xml refers to custom types, you will need to ensure that you can access the Nodeset2.xml file of the remote OPC UA server and import it into the Sterfive OPCUA Omni Edge Server configuration.

Do this by either contacting the vendor of the OPC UA server.

Alternatively you can use the Sterfive's opcua-toolbox utility to extract the Nodeset2.xml file from the remote OPC UA server and import it into the Sterfive OPCUA Omni Edge Server configuration. Contact sterfive support for more information on how to do this.

$ opcua-toolbox nodeset --endpoint opc.tcp://opcuademo.sterfive.com:26541 --output folder