Programming an OPC UA .NET Client with C# for the SIMATIC NET OPC UA Server
To realize a data link between a controller and a PC system, standardized mechanisms are preferably used to ensure that such a data exchange remains independent of the used bus system or protocol or even manufacturer. OPC UA combines this functionality and additionally offers authentication and encrypted data transmission and advanced diagnostic information. In this example, the OPC UA Server is to be considered as an information server. The core task of this example is secure access to process data via the new OPC UA interface of the SIMATIC NET OPC Server.
The OPC UA Client in the PC station is realized at two levels of complexity. A client whose design is very simple (Simple OPC UA Client) shows you all basic functions and introduces you to OPC UA. A more complex client (OPC UA .NET Client) with a convenient user interface demonstrates professional OPC UA handling with reusable classes realized in .NET in the C# programming language.
The figure below shows the hardware configuration of this example:
The following scenarios are explained in terms of software in both sample clients:
- Logging on to, logging off from and authentication on the OPC UA Server
- Browsing the namespace of variables
- Reading, writing and monitoring variables
- Reading and writing when using S7 block services
- Using absolute and symbolic addressing
- Easy error handling
The more complex OPC UA Client example additionally includes field-proven classes and controls in .NET, intended to facilitate programming of individual OPC UA Clients. For this purpose, the complex OPC UA .NET Client SDK methods are encapsulated in a client API that is easier to use.
Client user interfaces
Simple OPC UA Client user interface:
Advanced OPC UA Client user interface:
The following documents additionally deal with OPC-Client programming:
Individual Signaling System Based on the SIMATIC NET OPC Alarm and Event Server
OPC Communication via the SEND/RECEIVE Protocol with a Visual Basic .NET OPC Client
Using the XML-DA Interface of the SIMATIC NET OPC Server with Visual Basic .NET
External Block Management with S7 Block Management Services of the SIMATIC NET OPC Server
Mass Data Acquisition with an OPC Client in C# Based on .NET
Individual Visualization with OPC Based on Microsoft® .NET and the Programming Language C#
Distributed Automation with the PC - The SIMATIC NET OPC Server as DP Slave
Controlling with the PC - The SIMATIC NET OPC Inproc Server as DP Master
Migration to STEP 7 V14, change to "UAClientHelperAPI"