How to use OPC-UA with a Windows client
In this article we will show you how OPC-UA works and how you can use it easily.
OPC-UA is meanwhile the internationally established industry standard for data exchange. This allows data from machines to be transferred and made usable.
What is OPC-UA?
As industry grows and becomes more digital, more and more data must be exchanged between machines and plants. Hardware and software must therefore work more closely together in order to be able to directly monitor industrial plants.
OPC-UA is an industrial protocol, the name stands for Open Platform Communications. The first version appeared in the fall of 2006 and has been constantly updated and expanded since then. The UA stands for Unified Architecture, which is the latest specification of OPC.
When networking machines and industrial plants, problems can always occur, for example due to different and incompatible interfaces of the machines. Many manufacturers and software providers use their own, so-called “proprietary” protocols. The result: no or only limited compatibility, security risks and high follow-up costs.
OPC-UA finally puts an end to this. Thanks to the industry standard, it is possible to use machine data consistently, securely and without disruptions. It is therefore a standard for communication among machines, but also between machines and PCs or servers. The industry standard connects production with the IT world. Databases, ERP systems and other IT systems can finally be connected securely and easily.
Who uses OPC-UA?
Since the architecture is now the data standard in the industry, it is naturally also used by well-known companies and integrated into products, machines and systems.
Siemens, Honeywell, Microsoft, Beckhoff, SAP, Yokogawa, ABB, Rockwell, Schneider Electric, Wago, Iconics.
The industrial protocol has thus established itself on a broad front: many well-known companies use the data standard. But what is so good about it?
It is the industrial protocol of the future, since the infrastructure is maximally expandable and modifiable. Both OPC-UA data sources (e.g. industrial machines) and OPC-UA client applications can be exchanged flexibly. If required, even the server can be exchanged.
IT security is part of the industry standard. Your data is encrypted and your sessions are secured. In addition, the German Federal Office for Information Security (BSI) has conducted a security analysis and concluded that the data standard is very secure, while it allows targeted and controlled distribution of data.
OPC UA standardizes access to machines, devices and other systems. It is manufacturer and platform independent and therefore enables a similar exchange between machines, devices and other systems in the industrial environment. This means that older technologies can also be connected to newer ones without any problems, even if they come from different manufacturers. This results in high flexibility and compatibility.
As you can see, the communication protocol offers useful features to make better and safer use of machine data. But what data is actually in the control system of a machine? Typically, this valuable data can be found in machines and plants:
Note: OPC-UA is not the only way to use machine data. In the article “PLC-PC data exchange: Without OPC server?” we have compared the industry standard with an alternative.
What are the advantages of OPC-UA?
What advantages does the communication protocol offer? Is it worth purchasing or converting? In many cases, it does. Let it be the IT security in production, which is increased, or also the future viability by avoiding vendor lock-in effects. The Siemens S7 world also benefits, since optimized data blocks are now easily and securely accessible.
What do I need to be able to use OPC-UA?
The basic requirement for use is a network based on the Internet Protocol (IP). This is the case with the usual Ethernet technology and thus also Profinet. In addition, of course, you need a machine or plant with a programmable logic controller (PLC).
All modern Siemens S7 controllers support the architecture, but which controllers can you use? We recommend a Siemens S7-1500, alternatively you can use a S7-1200 (with limitations) or an ET 200. More about this further down in the article.
The communication is based on the client – server principle. With an installed OPC client a connection to an OPC server can be established. In this example we use the DataSuite software on a PC as OPC-UA client. The PLC acts as OPC-UA server.
What is needed:
As you can see, you don’t need much to use the communication protocol. As a client, we use the DataSuite software. You can find a free 30-day trial version here: DataSuite trial
In the next step, you will learn how to configure in TIA Portal.
Configuration in TIA-Portal
To use the communication protocol with a Siemens S7 you have to configure it first. But this is very simple. Here you get it explained step by step.
For the communication, the PLC acts as OPC-UA server. You must first activate this in your controller. To be able to read and write variables with a client, you must first set up a server interface in the TIA Portal.
To activate the server of the PLC, a runtime license from Siemens is required. The exact license depends on your PLC. The upper field shows the required license, while you select the respective license in the lower field.
The communication with controllers of the type S7-1200 is different to the S7-1500 controllers. To be able to use variables, you must create corresponding server interfaces in the S7-1200 beforehand.
Limited functionality with S7-1200 controllers
The OPC UA server of an S7-1200 offers significantly fewer functions than of an S7-1500. These limitations bring disadvantages in the application, but the communication still works without problems.
To establish an OPC-UA connection to your PLC, you have to configure some settings in the PLC.
To do this, open the settings of the PLC and select the OPC UA option. There you can activate the OPC-UA server and the standard SIMATIC server interface. Below that you can change the port of the connection (default: 4840).
In the menu item Security you will find the endpoints offered by the PLC. These differ in the respective security settings. Deactivate the endpoints that are not required here. We recommend that you use a signed and encrypted connection.
Now your PLC should be ready for use as OPC server. In the next step we will explain how to configure the OPC-UA Client (DataSuite).
You would like to get a live insight into DataSuite 3?
In a live online demonstration, we will go into detail about the individual functions and answer any questions you may have. Together we will find out whether DataSuite 3 is suitable for your needs.
Configuration of DataSuite as OPC-UA Client
Now you need a PC or a virtual machine with DataSuite software installed. If you have activated the OPC-UA Server as described above, you can establish an OPC-UA connection to your S7 PLC using DataSuite.
To create a new PLC connection in the software, select the “Controllers” item in the menu on the left. There you will find the [MB] simulator for testing, but in our case we want to set up a real PLC connection. Therefore please select “Create new PLC” and then choose the connection type “OPC-UA”.
After that you automatically reach the configuration of the OPC-UA connection. There you can select different security profiles and set a user name with password, which you have defined before in TIA.
Now test the connection with the button provided for this purpose and then save. Now you can import variables and use them as you wish throughout the program.
But what to do with the data or variables? In this example, we save them in an Excel file as a log. Please read our article “It works that easy: Writing Excel files with the Siemens S7” how you can easily use this OPC data for Excel files.
The result could look like this: A temperature curve in Excel via OPC-UA from a Siemens S7 PLC:
Much more information and setting options can be found in the DataSuite software manual, which is included in the download. There you can find detailed instructions with screenshots.
Further information and assistance free of charge from our support team:
Phone: +49 2742 72927 83
E-Mail: [email protected]
Modern Siemens S7 controllers come with an integrated OPC-UA server. With the [MB] DataSuite software as OPC-UA client for Windows, you can connect your machines and plants via OPC-UA, evaluate and use data. Client and server form the basis for a future-proof, secure and reliable networking of your production.
The useful life of solid machine technology is increased by retrofitting. Old machines and new possibilities.
You know our DataSuite software and therefore know that it is very versatile and offers many functions. In conversations with customers, I notice again and again that particularly exciting features are often not known. I have therefore compiled some interesting little-known features in this newsletter.
wouldn’t it be nice if you could provide data of machines and plants easily and quickly as web pages? Maybe even with a diagram and your logo? We have built exactly this function and many more into our [MB] DataSuite. Forget the S7 web server and use the fast and easy alternative in the form of our software.