Skip to main content

Example: OPC UA Data Source

Product: CODESYS OPC UA

The example shows how to configure a CODESYS Data Source in connection with an OPC UA Server. The example contains two applications: ServerApplication and ClientApplication. The applications are located on two different controllers. You can also download the applications to the same controller. In this case, you should not delete the application on the controller.

Description

The ServerApplication contains different values which are changed every second in the Server_PRG program. The values are published via the IEC symbol sets. The controller where this application is running must allow the anonymous UserToken and the "SecurityPolicy None".

For more information about how to set up an OPC UA Server correctly, see the following: OPC UA Server

The ClientApplication contains a CODESYS Data Source which is configured to use the OPC UA protocol. It connects to the OPC UA Server via the anonymous UserToken. The data source is configured to use the values of the ServerApplication. Before you can use this application, you need to adapt the OPC UA endpoint URL to the correct host name or IP address. To do this, open the Data Source object in the device tree and select the Communication tab.

Using secure communication

For a description of how to set up secure communication, see the following chapter: Establishing the Connection of a Data Source OPC UA Client to an OPC UA Server

System requirements and restrictions

Programming system

CODESYS Development System (version 3.5.19.0 or higher)

Runtime system

CODESYS Control Win (version 3.5.19.0)

Add-on components

CODESYS Communication (version 4.4.0.0 or higher)

Note

_example_icon.png DOWNLOAD Project