Connect to an OPC UA Server
If an OPC UA server is already registered on a Local Discovery Server (LDS), it is discovered automatically. Otherwise a OPC UA Datasource object (that will be acting as the OPC UA client) has to be created and configured first.
Before beginning, here are some prerequisites and considerations to be taken into account:
-
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 server. This can be downloaded for free from their website (requires you to create a free account)
-
Datasource objects are created underneath Folders objects in the I/O Model, the Folder object needs to be linked to an "owner" Node. Please read the instructions on creating and linking a Folder to a Node before creating the OPC UA Datasource object.
-
Accessing data sources is an administrative task so you must be logged into the System Config App as an administrator.
-
Navigate to a Folder in the I/O Model and right click to display the context menu and select to open the Create Object dialog.
-
In the Create Object dialog, open the External Interfaces section in the left-hand panel and select "Datasource UA".
-
Enter an Object Name for the Datasource.
-
Click on the OPC UA compound.
-
On the OPC UA page, enter the endpoint URL of the Server. This is normally of the form
opc.tcp://<hostmachine name>:<port number>. This information is can be found in the console window of the UA server.
Using the Container versionIf you are using the Container version of AspenTech Inmation Data Fabric, and are connecting to a OPC UA server on the same host machine as the container, the <host machine> part of the URL should be replaced by "host.docker.internal". For example:
opc.tcp://host.docker.internal:48020The Replace discovered hostname property should also be selected and the changes applied.
-
More configuration options for OPC UA Datasources are available in the object but for this example we will use the default configuration. So click Create to create the OPC UA Datasource object in the I/O Model. It should connect and show 2 green lights soon.
-
Right-click on the newly created OPC UA Datasource object in the I/O Model panel and select from the context menu to browse the Datasource.
-
Expand the OPC namespace and check values are updating in one of the example tags by selecting one and expanding the Object Lens
-