How to Connect to an OPC Classic Data Source

This section explains how to connect to an already discovered OPC classic data source.

Before you begin!

  • For this example we use simulation OPC DA servers. Free simulation servers can be downloaded from Softing and Matrikon for use in this tutorial.

  • Data sources can only be discovered by 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

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

Navigate to the Connector and expand the object tree to show any discovered datasources. Right click on the datasource to display the context menu and select Admin > Enable > Object (shortcut F9) to enable the object.

Enabling a Datasource
Figure 1. Enabling a Datasource
  • Once the OPC data source is enabled, the Connector automatically connects to it and reports its state. If the connection is good, the data source object will show two green lights beside it in the model panel.

Successfully Connected Datasource
Figure 2. Successfully Connected Datasource
  • In this example it is a OPC DA data source that is enabled. With OPC DA access the namespace items of the data source are not automatically added without browsing.

There are good reasons for this. In a real life production scenario, the DA namespace can be huge, containing many items. Therefore, reading it ("browsing" in OPC terms) can cause considerable load on the OPC server. In addition these namespaces often contain many more objects than are of interest, or should be read by, system:inmation. Even if the OPC server can cope with such a request, this could result in a very large object structure that is mostly unused. Only browse the full DA namespace when you are sure the OPC Server is able to cope with such a request! system:inmation allows you to filter for objects when browsing in multiple ways, on the server and the client side. Refer to the data source properties in the system documentation for detailed information about how to influence the browsing of OPC servers.
  • In this example we are connecting to an OPC server that simulates data and is safe to browse without any filters. Right click the data source object and select the menu option Admin > Advanced Functions > Browse Once from the context menu.

Browse OPC DA datasource once
Figure 3. Browse OPC DA datasource once
  • The command is send to the Connector and the browse is executed. When the Connector discovers new objects they are added to the I/O Model, and the tree will automatically update accordingly.

Updated OPC Data Source
Figure 4. Updated OPC Data Source
  • Now all the OPC DA folders and items discovered in the server’s namespace are Folder and I/O Items. Therefore, they are objects in the system:inmation I/O Model and can be used in displays, calculations and other operations.

Training Task: Use Newly discovered items
Create a display using discovered I/O items by dragging them to an open display or using the I/O item context menu to add them to a display.
Training Task: Re-Discover Objects
Delete some of the I/O items and use Browse Once to rediscover objects. What happens to the history data of these objects?