Interfacing Siemens WinCC Unified RT with Arduino OPTA (in an existing Siemens network)
WinCC Unified is a very powerful and flexible HMI platform, intended to replace the well-known WinCC Advanced/Professional in the Siemens ecosystem.
Unlike its predecessors, and in line with the best competitor systems, it is completely based on Web technology (HTML5, SVG graphics, etc.).
It allows you to scale towards highly elaborate customized applications, thanks to the ability to manage scripts in JavaScript (not a proprietary language therefore) and to create customized controls starting from open-source libraries available online.
The name Unified was born from the desire to unify applications through a single tool, starting from a simple station HMI, up to complex plant Scada.
Arduino OPTA is a small PLC, I have written several times about it (in this article and in this other one), it is a system that I really like because it combines a very low price with very interesting features.
It is born programmable relay and is also referred to as such by the manufacturer, however, it is much more like a micro-PLC, in fact, programmable relays generally use different tools than those of the larger families; they have many limitations that makes them suitable for simplified uses.
In this case we are dealing with a full compliant IEC61131-3 system that also allows for the integration of C++ code directly into the programming environment.
It is a PLC that I would call PRO/STEM, it is suitable for small professional realizations (let's not forget the market segment in which it is placed) but it is also an excellent tool for school-age or pre-professional PLC learning.
The dual nature of this PLC is evident when we go to program it; in fact, we can use both Arduino IDE, in C++, the tool of choice for Makers, and Arduino PLC IDE for a more professional use.
The purpose of this tutorial is to integrate Arduino OPTA into an existing Siemens HMI network, that is, to create a page through which we can interact with the OPTA Inputs and Outputs and view/modify its internal variables.
Let's start by saying that interfacing WinCC with OPTA is not an activity for hackers, OPTA allows communication in Modbus/TCP and WinCC manages multiple connections with mixed networks, among which there is Modbus/TCP.
So, they are two objects compatible by design.
However, proceeding in a haphazard manner by changing many parameters at the same time, in addition to not offering us a logical thread, risks transforming a very simple activity into hours of fruitless attempts.
The purpose of this tutorial, therefore, is to understand how to proceed, in a simple and orderly way, to create a mixed architecture in a few minutes.
We will not see how to connect WinCC to a PLC S71200/1500, the prerequisite, therefore, is to already have a basic TIA Portal WinCC/PLC project working.
We will see how to prepare a WinCC HMI system to host a connection to OPTA and we will create together a small program for Arduino OPTA with all the variable management.
As always, it's not just theory, at the end of the article you will find the link from which to download all the working projects.
System architecture
Phase 1: Preparing Arduino OPTA
To prepare Arduino OPTA, these steps are needed.
The cost of an HMI runtime license depends on the number of Tags used. An optimization, that is worth learning right away, is to exchange Boolean variables for bits within a word. In this way, to exchange 16 bits, we will need only one Word Tag instead of 16 Bool Tags. Extracting or inserting bits in a Word, as we will see, is a very simple operation thanks to the possibility of addressing the individual bits directly in the variable name.
OPTA.1 – Enabling the Ethernet communication
Create a new OPTA Project with Arduino PLC IDE.
OPTA.2 - Creating the HMI exchange variables
Let's create the variables that will be 1:1 with the HMI Tags.
OPTA_DIN and OPTA_DOUT will contain the I/O bit-map. To address the bits is important to set their PLC type as WORD.
Take a screenshot of this page, it will be useful when you need to insert tags into the HMI.
OPTA.3 – Hardware resources mapping
OPTA.4 – Preparing the interface programs
领英推荐
Fill Process_IN
Fill Process_OUT
Expand the Fast Task and arrange the programs as in figure.
OPTA.5 – Preparing the main program
OPTA is ready to run.
Phase 2: Preparing WinCC Unified RT
To prepare WinCC, these steps are needed.
WinCC.1 – Creating the OPTA connection
WinCC.2 – Creating the interface Tags
WinCC.3 – Creating the OPTA Screen
Explaining in detail the use of WinCC controls is beyond the scope of this tutorial, moreover this activity does not change at all for PLCs of different brands. However, we will see a couple of examples to understand how to select the Tags correctly.
WinCC.4 – Attaching Tags to the controls
Example 1: parametrizing a Slider
Example 2: parametrizing a LED
Go Live !
In my Github repository you can find the two projects (TIA Portal WinCC and Arduino IDE OPTA) used to write this tutorial.
They are ready to be compiled and uploaded to the two systems.
There are two pages, this is what you will see:
Have fun...
Indagini Termografiche ed Estensimetriche UNI EN ISO 9712:2012 Docente di Laboratorio in Meccatronica ed Energia
2 个月Davide Nardella Piano piano, verranno fuori le qualità dell'OPTA
Industrial automation through Intelligent systems
2 个月I have only recently been able to use the modbus tcp blocks in the plc opta as well. I like it so far. We are connecting it to Ignition for a two way control on a touch screen monitor.
Direttore commerciale presso HDT Srl
2 个月Mi piace