How to Connect to an OPC UA Server

OPC UA servers are only discovered automatically if they are already registered using Local Discovery Server (LDS). Otherwise a Datasource will have to be first created and configured. The Datasource acts as the OPC UA client.

Before starting!, here are some premises that were taken into account for the realization of this set up.

  • This section refers to the OPC UA specification. For information on the different OPC specifications visit the OPC Foundation website.

  • In this example we use an OPC UA ANSI C simulation server from Unified Automation to demonstrate how to connect an OPC UA sever. This can be downloaded for free from their website (requires you to create a free account)

  • Data sources can only be created underneath a Connector so please make sure that a Connector has already been created (see previous section for details)

  • Accessing data sources is an administrative task so you must be logged into DataStudio as an administrator. To get more information about accessability visit the section How to create a Profile.

Follow this simple steps to connect to an OPC Datasource.

  1. Navigate to the Connector and right click to display the context menu and select Admin → New → External Interfaces → Datasource to open the Create Object wizard.

    Adding a Datasource
    Figure 1. Adding a Datasource
  2. In the Create Datasource wizard, enter a name and description for the Datasource and click Next.

    Create Datasource Wizard
    Figure 2. Create Datasource Wizard
  3. In the second part of the wizard the Server type can be selected from the drop-down menu (select OPC UA). For OPC UA servers which are not automatically discovered, the endpoint URL must be entered. This is normally of the form opc.tcp:<hostmachine name>:<port number> but you can check this in the console window of the UA server.

    Create Datasource Wizard - Server Type
    Figure 3. Create Datasource Wizard - Server Type
    OPC Server Console Window
    Figure 4. OPC Server Console Window
  4. Scroll down to the OPC Client Options section and open Session Options. Here you can configure the Locale (the country and language) to be used for the session once connection is made. The default is English.

    Session Locale
    Figure 5. Session Locale
  5. More configuration options for the OPC UA Datasource are available in the wizard but for this example we will use the default configuration. Click Create to create the Datasource in the I/O Model panel. It should connect and show 2 green lights.

  6. Right-click on the Datasource in the I/O Model panel and select Admin  Advance Functions  Browse Once from the context menu to browse the Datasource.