×
Siemens Industry Online Support
Siemens AG
Entry type: Application example Entry ID: 42014088, Entry date: 06/29/2018
(7)
Rate

Programming an OPC UA .NET Client with C# for the SIMATIC NET OPC UA Server

  • Entry
  • Associated product(s)
Using the SIMATIC NET OPC UA server as gateway, you can access your controllers via OPC UA. OPC UA enables inter-manufacturer communication as well as easy connection to the MES / ERP level.

Problem  
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.

 
Solution
  
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:


Picture 01

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:

Picture 02

Advanced OPC UA Client user interface:

Picture 03

 
Downloads

  Documentation of the example (3,1 MB)
 Registrierung notwendig  .NET sample client with and TIA project (V14) (6,2 MB) 

 
Further Information
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

 
Last change
Migration to STEP 7 V14, change to "UAClientHelperAPI"


Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit
https://www.siemens.com/cybersecurity#Ouraspiration.