Content of the page:

This page will be re written as CLIENT SOON….

What is OPC UA

How it is used (in our example home automation and in industries)

Download necessary tool

OPC UA modeler

OPC UA server development

OPC UA client development in C#

OPC UA client development in structured text (For PLC)

What is OPC UA

OPC stands for OLE for Process Control which clearly shows that it comes out of the Microsoft community, based on the OLE and DCOM technology. OPC UA (Unified Automation) is platform independent. It works in Microsoft Windows, Mac and Linux operating system.

OPC-UA servers: Servers provide the physical interface to the real world. Servers measure physical properties, indicate status, initiate physical actions and do all sorts of physical measurements and activation in the real world under the direction of a remote Client device. Servers read the real world data from sensors and devices and send back to OPC-UA clients. Server can pass the alarms and event generated by the devices which are under control of the servers. Servers are where the physical world meets the digital world.

OPC-UA Clients: Clients  read and write data from/to servers. Clients can subscribe interesting data from the server. Server can notify the client that your interested data has been changed. Server can notify any alarm if it has been activated.

Platform Independence:  Basically client and server are software that run independent of operating system in uniform way. Client can be written in for example in Windows C# language and Server can be implemented in Linux OS with Python. A C# client can be easily access the server data.

 Functional Equivalence:
OPC UA provides the following functionalities. 
 
Discovery: find the availability of OPC Servers on local PCs and/or networks
Address space: all data is represented hierarchically (e.g. files and folders) allowing for simple and complex structures to be discovered and utilized by OPC Clients
On-demand: read and write data/information based on access-permissions
Subscriptions: monitor data/information and report-by-exception when values change based on a client’s criteria
Events: notify important information based on client’s criteria
Methods: clients can execute programs, etc. based on methods defined on the server
How OPC UA is used

OPC UA server reads all the data from actual devices and makes it available for the client. In the usual cases, say for example, we have an alarm in our valve, this is read by the OPC UA server and pass it to the client application, client application can be HMI/SCADA system. OPC Servers collect data from different sources so clients can access those data.

Client examples:

SCADA/HMI => display or process data by acquiring from the OPC server

PLC => Read data from server and use for processing data and  react based on the data

OPC Server examples:

PLC => Acquire data from different devices and use it for making decisions based on the data, PLC can be a client and Server at the same time. It can have 2 different processes running in the PLC

Any HW/SW => Different applications running in an HW for collecting data from sensors and processes and making those available for OPC clients

Figure 01: General view OPC Server and Clients (image source internet)

Download necessary tools

We need to download the following software bundle from unified automation site, the address:
https://www.unified-automation.com/downloads/opc-ua-development.html

We shall focus on our example with this background information. We shall design our OPC UA server that controls the lock, measure the temperature, open/close a valve and control a motor.  We shall show how to develop the OPC Server that we can run in Windows and Linux. We shall create also C#  OPC UA client and PLC client (PLC client will talk with OPC UA server.)

We shall show step by step what we need to do to create a model for our server.

 

 

OPC UA modeler

OPC UA modeler coming soon…

OPC UA Server Development

OPC UA Server development coming soon…

https://github.com/OPCFoundation/UA-.NETStandard

OPC UA client development in C#

How to connect a OPC Server.

EndpointDescription endpoint = null;
endpoint = new EndpointDescription(ConnectionUri);
session = new Session();
session.ConnectionStatusUpdate += OnConnectionChange;
RequestSettings req = new RequestSettings();
req.OperationTimeout = 10 * 1000;
session.DefaultRequestSettings = req;
session.Connect(endpoint, RetryInitialConnect.Yes, session.DefaultRequestSettings);



OPC UA client development in structured text

Coming more …

OPC AE  => OPC Alarms and Events

=>Some reference related to OPC  -> https://reference.opcfoundation.org/v104/

OPC UA Online Reference

Online versions of OPC UA specifications and information models.

=> open62541 Documentation  ->  https://open62541.org/doc/0.2/toc.html  and https://manualzz.com/doc/29886981/open62541-documentation

open-source implementation of OPC UA

=> Personal OPC UA  blog https://opcua.rocks/ 

=> https://opcfoundation.github.io/UA-.NETStandard/help/overviewsecuringapplications.htm (certificate)

 

Ask questions related to Hemelix sample code and design at Google group https://groups.google.com/g/hemelix