Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Edge Data Store

Data source configuration

  • Last UpdatedSep 25, 2025
  • 6 minute read

For each instance of the OPC UA (Open Platform Communications - Unified Architecture) EDS (Edge Data Store) adapter defined in system configuration, you must configure the data source from which it will receive data.

Configure OPC UA data source

Note: You cannot manually configure OPC UA (Open Platform Communications - Unified Architecture) data source configurations. You must use the REST (REpresentational State Transfer) endpoints to add or edit the configuration.

To configure the OPC UA (Open Platform Communications - Unified Architecture) data source:

  1. Using any text editor, create a file that contains an OPC UA (Open Platform Communications - Unified Architecture) data source in JSON (JavaScript Object Notation) format.

  2. Modify the parameters in the example to match your environment.

  3. Save the file to the device with EDS (Edge Data Store) installed using a file name based on the adapter instance name. For example, to use the adapter instance created during installation, which is OpcUa1, name the file OpcUa1Datasource.json.

  4. Use any tool capable of making HTTP (Hypertext Transfer Protocol) requests to execute a POST command with the contents of that file to the following endpoint: http://localhost:<port_number>/api/v1/configuration/<EDS_adapterId>/DataSource/.

    Definition: The POST method is used to create new resources.

The following examples show the HTTPS (Hypertext Transfer Protocol - Secure) request using cURL (Client for URL) and EdgeCmd utility using the adapter instance created during installation, which is OpcUa1:

curl -d "@OpcUa1DataSource..json" -H "Content-Type: application/json" "http://localhost:5590/api/v1/configuration/OpcUa1/DataSource"

edgecmd set dataSource -cid OpcUa1 -file OpcUa1DataSource.json

Note: After completing data source configuration, you need to configure data selection next. You can either generate a default data selection file or create the data selection file manually.

Export OPC UA dynamic variables

The OPC UA (Open Platform Communications - Unified Architecture) EDS (Edge Data Store) adapter is able to export available OPC UA (Open Platform Communications - Unified Architecture) dynamic variables by browsing the OPC UA (Open Platform Communications - Unified Architecture) hierarchies or sub-hierarchies as part of the data source configuration process.

  1. To limit browsing, specify a comma-separated collection of nodeIds in data source configuration file using the RootNodeIds parameter.

    Note: The nodeIds are treated as roots from which the adapter starts the browse operation.

    The adapter triggers an export operation after a successful connection to the OPC UA (Open Platform Communications - Unified Architecture) server when the data selection file does not exist in configuration directory.

  2. Copy the exported data selection JSON (JavaScript Object Notation) file from the directory or retrieve it using a REST API (REpresentational State Transfer - Application Programming Interface) call.

  3. (Optional) To avoid a potentially long and resource-intensive browse operation, create the data selection file manually. Configure it before you configure the data source or push both in one configuration call together.

    Parameters for OPC UA (Open Platform Communications - Unified Architecture) data source

    The following parameters are available for configuring an OPC UA (Open Platform Communications - Unified Architecture) data source:

    Parameter

    Required

    Type

    Description

    endpointURL

    Required

    string

    The endpoint URL (Uniform Resource Locator) of the OPC UA (Open Platform Communications - Unified Architecture) server in opc.tcp format. The following is an example of the URL (Uniform Resource Locator) format: opc.tcp://OPCServerHost:Port/OpcUa/SimulationServer

    Note: If you change the EndpointURL on a configured adapter that has ComponentID_DataSelection.json file exported, you need to remove the ComponentID_DataSelection.json file from the configuration directory to trigger a new browse (export).

    Allowed value: well-formed opc.tcp address

    useSecureConnection

    Optional

    boolean

    When set to true, the adapter connects to a secure endpoint using OPC UA (Open Platform Communications - Unified Architecture) certificate exchange operation. The default is true. When set to false, the adapter connects to an unsecured endpoint of the server and certificate exchange operation is not required.

    Note: We recommend setting this option to false for testing purposes only.

    Allowed value: true or false

    Default value: true

    userName

    Optional

    string

    User name for accessing the OPC UA (Open Platform Communications - Unified Architecture) server.

    Allowed value: any string

    Default value: null

    password

    Optional

    string

    Password for accessing the OPC UA (Open Platform Communications - Unified Architecture) server.

    Note: We recommend using REST (REpresentational State Transfer) to configure the data source when the password must be specified because REST (REpresentational State Transfer) will encrypt the password. If you do not use REST (REpresentational State Transfer), the plain text password is stored on-disk.

    Allowed value: any string

    Default value: null

    incomingTimestamp

    Optional

    string

    Specifies whether the incoming timestamp is taken from the source, from the OPC UA (Open Platform Communications - Unified Architecture) server, or should be created by the adapter instance.

    • Source - Default and recommended setting. The timestamp is taken from the source timestamp field. The source is what provides data for the item to the OPC UA (Open Platform Communications - Unified Architecture) server, such as a field device.

    • Server - In case the OPC UA (Open Platform Communications - Unified Architecture) item has an invalid source timestamp field, the Server timestamp can be used.

    • Adapter - The adapter generates a timestamp for the item upon receiving it from the OPC UA (Open Platform Communications - Unified Architecture) server.

      Allowed value: Source, Server, or Adapter

      Default value: Source

    streamIdPrefix

    Optional

    string

    Specifies what prefix is used for Stream IDs. The naming convention is {StreamIdPrefix}{StreamId}. An empty string means no prefix will be added to the Stream IDs and names. A null value defaults to ComponentID followed by a period.

    Example: OpcUa1.{NamespaceIndex}.{Identifier}

    Note: Every time you change the StreamIdPrefix of a configured adapter, for example when you delete and add a data source, you need to restart the adapter for the changes to take place. New streams are created on adapter restart and pre-existing streams are no longer updated.

    Allowed value: any string

    Default value: null

    defaultStreamIdPattern

    Optional

    string

    Specifies the default stream Id pattern to use. Possible parameters: {NamespaceIndex}1, {Identifier}.

    Allowed value: any string

    Default value: {NamespaceIndex}.{Identifier}

    dataCollectionMode

    Optional

    string

    Specifies the data collection mode the adapter is in. The following data collection modes are available:

    • HistoryOnly2: The adapter component does not get started and history recovery on-demand is enabled. For more information, see On-demand history recovery configuration.

    • CurrentOnly: The adapter component operates normally and on-demand history recovery is disabled.

    • CurrentWithBackfill2: The adapter component operates normally, but disconnections are recorded based on device status. History recovery backfills data once device status is good. On-demand history recovery is disabled. For more information, see Automatic history recovery.

      Changing the mode requires a restart of the adapter component.

    1 NamespaceIndex refers to the number specified in the ns keyword in the RootNodeIds parameter.

    2 Historical values are collected only for OPC UA (Open Platform Communications - Unified Architecture) items that have the AccessLevel attribute set to HistoryRead.

    OPC UA (Open Platform Communications - Unified Architecture) data source examples

    The following are examples of valid OPC UA (Open Platform Communications - Unified Architecture) data source configurations:

    Minimal data source configuration

    [

    {

    "endpointUrl": "opc.tcp://<IP-Address>:<Port>/<TestOPCUAServer>"

    }

    ]

    Complete data source configuration

    [

    {

    "endpointUrl": "opc.tcp://<IP-Address>:<Port>/<TestOPCUAServer>",

    "useSecureConnection": true,

    "userName": null,

    "password": null,

    "incomingTimestamp": "Source",

    "streamIdPrefix": null,

    "defaultStreamIdPattern": "{NamespaceIndex}.{Identifier}",

    "dataCollectionMode": "CurrentWithBackfill"

    }

    ]

    REST URLs

    HTTP verb

    Relative URL

    Action

    api/v1/configuration/<ComponentId>/DataSource

    Retrieves the data source configuration.

    api/v1/configuration/<ComponentId>/DataSource

    Creates the data source configuration. The adapter starts collecting data after the following conditions are met:

    - The data source configuration POST request is received.

    Definition: The POST method is used to create new resources.

    - A data selection configuration is active.

    api/v1/configuration/<ComponentId>/DataSource

    Configures or updates the data source configuration. Overwrites any active data source configuration. If no configuration is active, the adapter starts collecting data after the following conditions are met:

    - The data source configuration PUT request is received.

    Definition: The PUT method is used to replace an existing resource with an updated version.

    - A data selection configuration is active.

    api/v1/configuration/<ComponentId>/DataSource

    Deletes the data source configuration. After the request is received, the adapter stops collecting data.

    Note: Replace ComponentId with the Id of your OPC UA component, for example OpcUa1.

    In This Topic
    Related Links
    TitleResults for “How to create a CRG?”Also Available in