OPC UA Client Example
OPC UA Client Example
The example ‘OPCUAClient_Example’ demonstrates how to use the CODESYS OPC UA Client
programmatically. It contains visualizations to access the applied functions via a user interface. The example
‘OPCUA_Datasource_Example’ demonstrates how a CODESYS OPC UA connection can be set up via data
source manager.
Product description
Licensing:
No license is required.
‘OPC UA Client Example’ demonstrates how to use the IEC 61131-3 interface of the CODESYS OPC UA Client.
It contains function blocks to connect to and exchange data with other OPC UA Servers. Also it contains two
visualizations to operate the cited function blocks via a user interface and check server certificates.
‘OPC UA Datasource Example’ uses for communication between server and client the data source manager. A
direct read of values in device set can be done in client.
Application
OPC UA Client Example: The example contains a project with two applications: UAClientDemo and
UAServerData.
UAClientDemo contains function blocks for using the CODESYS OPC UA Client.
UAConnection: To establish the connection to any OPC UA Server
UABrowse: To send browse requests to an OPC UA Server
UASubscription: To generate OPC UA subscriptions
UAMonitoredItem: To monitor OPC UA variables (“Monitored Items”)
UAAttributes: To send read/write commands to the OPC UA Server
UAClient: Maps the state machine for the OPC UA Client to establish and terminate connections and is the
basis for the visualization
UAServerData publishes a data set via the CODESYS OPC UA Server.
OPC UA Datasource Example: The example contains two projects OPC_UA_SERVER and OPC_UA_CLIENT with
each an application.
In the application of server, Application_DataSource, different values are written in Server_PRG and they are
send via symbol configuration.
A data source manager is included to client application to read the data, the received values can be accessed
in Main_PRG.
Visualization
The example contains two visualizations: CheckCertificate and Visualization.
CheckCertificate provides a user interface to accept server certificates one time and then to establish a
secure connection. To trust server certificates permanently, the CODESYS Security Agent can be used
([Link]
Visualization provides a user interface to operate the CODESYS OPC UA Client by using the UAClient
function block.
1/2
OPC UA Client Example
General information
Supplier:
CODESYS GmbH
Memminger Strasse 151
87439 Kempten
Germany
Support:
[Link]
Item:
OPC UA Client Example
Item number:
000119
Sales:
CODESYS Store
[Link]
Included in delivery:
CODESYS package with sample projects
License agreement
System requirements and restrictions
Development system CODESYS Development System V3.5.17.0 or higher
Runtime CODESYS Control V3.5.17.0 or higher
Supported platforms and devices
Additional requirements Runtime system component CmpOPCUAClient
Restrictions The connection to OPC UA Servers is possible via an IP
address only, not via a host name.
To establish secure server-client communication, a client
certificate has to be generated on the controller by means of
the CODESYS Security Agent
([Link] before
the connection is established.
Licensing
No license is required.
Required accessories
Note: Not all CODESYS features are available in all territories. For more information on geographic restrictions,
please contact sales@[Link].
Note: Technical specifications are subject to change. Errors and omissions excepted. The content of the
current online version of this document applies.
2/2