OPC-UA - TIA Portal Step by Step Communication Guide
OPC-UA - TIA Portal Step by Step Communication Guide
Sofiane KHELIFI
04/11/2024
الر ِح ِيم َّ ِبس ِْم اللَّـ ِه
َّ الرحْ َم ٰـ ِن
Contents :
1. Introduction
2. Prerequisite
3. Important notes
4. Setting up a new project in TIA Portal
5. Configuring the server interface
6. Setting the IP address for a virtual adapter
7. Configuring PLCSIM Advanced
8. Configuring UA Expert
9. Adding a new UA server
10. Conclusion
11. References & Resources
1
1. Introduction
OPC Unified Architecture (UA) is an open-source communication protocol that
has stood out as a cross-platform protocol in recent years. This is because OPC
UA is now the go-to protocol for industrial control devices, embedded system
devices, and other industrial equipment. It is a reliable mechanism as it offers
better security of plant data and a complete information model than other
traditional protocols. OPC UA has a similar Client-Server structure as Modbus
TCP but it is more versatile and robust than it. This tutorial will teach you how to
configure an S7-1500 PLC as an OPC UA server in TIA Portal.
2. Prerequisite
In order to follow along with this tutorial, you will need:
3. Important notes
OPC UA will not work for S7-1200 PLCs that have below version 4.4
firmware and version 2.5 for S7-1500 PLCs. This is why OPC UA
works best from TIA Portal V16. Also, from TIA V16, the certificate
license for OPC UA has already been included in the software, so
there is no need to purchase a separate license.
2
4. Setting up a new project in TIA Portal
Let us start by creating a new project
3
Activate the OPC UA server from the OPC UA navigation. The server
address should be noted because the OPC UA client device will
connect to the server through this address. The OPC server address
contains the IP address and the port number. In this example, the port
number is 4840.
4
In security navigation, TIA Portal automatically generates the server
certificate for you; this certificate is a basic one and is self-
signed. You can author new self-signed certificates if you wish; you
can do that by clicking on the harbinger icon and generating new
certificates.
There are security policies that help in enhancing data during transmission. To
limit client access to a server, companies can send you their license
information, and you would add them under trusted clients.
Next, create a new data block that will contain the OPC UA data.
5
5. Configuring the server interface
The server interface is used in configuring interfaces for the OPC UA
server. There can be more than one interface configured for a
particular server. This will help in orderly arrangement and simplicity.
6
After creating the interface, on the right-hand side, under OPC UA
elements, you can see the program blocks and plc tags created in your
program, same as technology objects. Navigating to program blocks,
highlight your data block and drag it over to the left-hand side – Under
OPC UA server interface.
7
7. Configuring PLCSIM Advanced
Open the PLCSIM Advanced 4.0 software and under online access select
PLCSIM Virtual Adapter
8
Now select Start Virtual S7-1500 PLC and configure it as shown in the
image bellow. The IP address is the same as that of the PLC device we
created. Then click on start to begin the simulation.
9
Go over to TIA Portal and head over to the project name under the
project tree and select properties; then, under protection, tick the support
simulation during block compilation. Finally, compile and download the
program into the simulator.
10
Go online with the PLC and select run in the PLCSIM advanced software.
Finally, Input some data in the OPC data block.
11
8. Configuring UA Expert
UA expert is a complete software package that can serve as an OPC UA
client device for testing for OPC UA. It is robust enough to handle
securities and certificate management. Launch UA expert.
12
9. Adding a new UA server
Navigate to Server and click on add. A new window pops up that will take
specific parameters. Give a configuration name.
13
If your communication is successful, you will see your device under the
custom delivery navigation.
14
The security is none because we are not currently using any security
feature for the certificate. Navigate to the address space window, and
your server parameters will be shown.
15
Highlight all the data registers and drag them onto the Data Access View
window.
You can see the OPC UA server's values, server name, timestamps, and
status. This is automatically updated as the register values changes.
Apart from just the registered data, other information can be pulled out
from the OPC UA server. Clicking on the PLC name in this example
(PLC_1), you can see the manufacturer name undervalue in the Attribute
window, same as the version of TIA Portal used in programming, the S7
CPU type, etc.
16
17
Other parameters of the UA server are available to the client by
navigating through the various attributes and values.
18
10. Conclusion
OPC UA is a protocol actively used in the industrial
internet of things (IIOT) and industry 4.0 trends due
to its versatility in communicating with different
devices. It is a protocol that manufacturers have
adopted for system integration and connectivity
purposes. More studies should be made in-depth
into the OPC UA protocol as it has come to stay.
19
11. References & Resources:
• SolisPlc https://www.solisplc.com/tutorials/opc-ua-server-
communication-in-siemens-tia-portal
20
ACKNOWLEDGEMENT
First of all I hope that Allah will make this work a continuous charity for me and for everyone
who shares it, and I hope this article resonates with you and provides value in your own
journeys. May it serve as a source of inspiration, guidance, or perhaps a gentle nudge toward
your own aspirations. Together, we can continue to uplift and empower one another.
Thank you for being part of this incredible journey. I look forward to what lies ahead and to
supporting each of you in your endeavors.
Warm regards,
KHELIFI SOFIANE
https://www.linkedin.com/in/sofiane-khelifi-8501a01a4
21