Cookies are important for this site to function properly, to guarantee your safety, and to provide you with the best experience. By clicking OK, you accept all cookies. For more information, please access our Privacy Policy.
Table of Contents
Tutorials / 
An Introduction to Siemens’ legacy HMI programming using WinCC Flexible
Intermediate

An Introduction to Siemens’ legacy HMI programming using WinCC Flexible

Siemens
WinCC
HMI Development

Introduction

This tutorial builds on the knowledge gained from the previous SIMATIC Manager introduction and SIMATIC programming tutorials. Here, we will cover the second essential software for programming Siemens’ legacy industrial equipment. Unlike TIA Portal which includes PLC and HMI programming in a single environment, these two parts were separated into two distinct software; SIMATIC Manager (also called Step 7) for programming PLCs and WinCC Flexible for programming HMI panels. We will focus on the configuration and programming of HMI using WinCC Flexible.

WinCC Flexible is a vital software tool used for programming and configuring Siemens's legacy HMI panels such as the popular OP and TP series. You can create graphical interfaces that interact with your PLC programs and monitor them. These interfaces play a crucial role in industrial automation, allowing operators to interact with and control machinery. 

In this tutorial, you will learn how to set up a new project in WinCC Flexible and gain insights into its interface components. We will guide you through the process of integrating your HMI project into a PLC project in SIMATIC Manager, essential for seamless communication between the HMI and PLC. Additionally, we'll cover configuring connection settings and defining HMI tags, which are crucial for effective communication with the PLC. Finally, we'll dive into the HMI programming aspect, where you will learn to create buttons and animations to design a dashboard for controlling and monitoring your industrial processes. 

Prerequisites

To follow this tutorial, you will need an installation of SIMATIC Manager (Step 7) and WinCC Flexible. Here, we will be using versions 5.6 and 2008 SP5 respectively. No additional hardware or software is required.

Creating a new project and interface overview

Let’s start by creating a new WinCC Flexible project. First, open WinCC Flexible from your start menu.

Figure 1.1 - Siemens SIMATIC WinCC flexible | Opening WinCC Flexible
Figure 1.1 - Siemens SIMATIC WinCC flexible | Opening WinCC Flexible

Once done, WinCC flexible will open. Before breaking down the interface, we need to create a new project first. Click on “Create an empty project.”

Figure 1.2 - Siemens SIMATIC WinCC flexible | Creating a new project
Figure 1.2 - Siemens SIMATIC WinCC flexible | Creating a new project

Next, you will arrive at a window where you must select the model the HMI model you will use in your project.

Figure 1.3 - Siemens SIMATIC WinCC flexible | HMI model selection
Figure 1.3 - Siemens SIMATIC WinCC flexible | HMI model selection

For this example, we will use a TP 270 10” panel which is one of the most popular HMIs. Open the “Panels” section, then select “TP 270 10” in the “270” section.

Figure 1.4 - Siemens SIMATIC WinCC flexible | Selecting the TP 270 10” panel
Figure 1.4 - Siemens SIMATIC WinCC flexible | Selecting the TP 270 10” panel

Once done, we arrive at WinCC Flexible’s main interface. Here, you can configure your HMI panel and program it.

Figure 1.5 - Siemens SIMATIC WinCC flexible | WinCC Flexible’s main interface
Figure 1.5 - Siemens SIMATIC WinCC flexible | WinCC Flexible’s main interface

The interface is organized as follows:

  1. Projet tree: here, you can find all the components of your project and access them.
  2. Workspace: This space represents the panel screen where you can assemble objects to form your HMI program.
  3. Objects and tools: Here, you can find all the objects and tools that you can use during programming.
  4. Properties view: Upon selecting an object, its properties will appear in this view.

Integrating to SIMATIC Manager (Step 7)

The first thing we need to perform is to associate this HMI project with a PLC project in SIMATIC Manager. For this, we will integrate this WinCC Flexible project into the project we created in the SIMATIC Manager programming tutorial.

Figure 2.1 - Siemens SIMATIC WinCC flexible | Used SIMATIC Manager project
Figure 2.1 - Siemens SIMATIC WinCC flexible | Used SIMATIC Manager project

Go to the “Project” menu of WinCC Flexible and click on “Integrate in STEP 7.”

Figure 2.2 - Siemens SIMATIC WinCC flexible | Integrating the WinCC project into SIMATIC Manager
Figure 2.2 - Siemens SIMATIC WinCC flexible | Integrating the WinCC project into SIMATIC Manager

This will open a small window where all your SIMATIC Manager projects are displayed. Here, we will select the “Programming” project.

Figure 2.3 - Siemens SIMATIC WinCC flexible | Selecting the target SIMATIC Manager project
Figure 2.3 - Siemens SIMATIC WinCC flexible | Selecting the target SIMATIC Manager project

Wait for the integration to complete.

Figure 2.4 - Siemens SIMATIC WinCC flexible | Integration’s progression
Figure 2.4 - Siemens SIMATIC WinCC flexible | Integration’s progression

If you open the SMATIC Manager project, you will find a new section in the project tree dedicated to the HMI.

Figure 2.5 - Siemens SIMATIC WinCC flexible | The integration is complete
Figure 2.5 - Siemens SIMATIC WinCC flexible | The integration is complete

Connection settings

Now that we integrated the projects, we need to configure the connection between the HMI and the PLC. For this, open the “Connections” section in the project tree.

Figure 3.1 - Siemens SIMATIC WinCC flexible | Opening the Connections settings
Figure 3.1 - Siemens SIMATIC WinCC flexible | Opening the Connections settings

Here, you can define the network connections between this HMI and other devices.

Figure 3.2 - Siemens SIMATIC WinCC flexible | Connections interface
Figure 3.2 - Siemens SIMATIC WinCC flexible | Connections interface

Double-click on the first row to create a new connection. Since we are communicating with an S7-PLC, be sure to have “SIMATIC S7 300/400” selected in the “Communication driver” section. Also, enter the address of the target PLC station you want to communicate with. Here, the address is set at “2.” You can refer to the SIMATIC Manager introduction tutorial for more information on how to set the network address of the PLC.

Figure 3.3 - Siemens SIMATIC WinCC flexible | Creating a connection
Figure 3.3 - Siemens SIMATIC WinCC flexible | Creating a connection

Defining HMI tags

Before we can start programming the HMI application, we need to define the tags (Variables) that will be used in our program. Since we are working with a motor control PLC program, we will need three boolean tags: one to start the motor, one to stop the motor, and the last to control the motor.

Open the “Tags” section in the project tree. 

Figure 3.4 - Siemens SIMATIC WinCC flexible | Tags interface
Figure 3.4 - Siemens SIMATIC WinCC flexible | Tags interface

To create a new tag, click on the first row of the list. This will automatically create a default tag that you can edit.

Figure 3.5 - Siemens SIMATIC WinCC flexible | Creating a tag
Figure 3.5 - Siemens SIMATIC WinCC flexible | Creating a tag

First, edit the name of the tag and set it to “Start_button.”

Figure 3.6 - Siemens SIMATIC WinCC flexible | Renaming the newly created tag
Figure 3.6 - Siemens SIMATIC WinCC flexible | Renaming the newly created tag

After that, set the data type to “Bool.”

Figure 3.7 - Siemens SIMATIC WinCC flexible | Selecting the Bool data type
Figure 3.7 - Siemens SIMATIC WinCC flexible | Selecting the Bool data type

After that, we need to link it to a SIMATIC Manager Symbol (See the SIMATIC Manager programming tutorial). Open the “Symbol” by clicking on the arrow button, browse to the S7 Program Symbols, and select the “Start_buton” tag.

Figure 3.8 - Siemens SIMATIC WinCC flexible | Selecting the “Start_button” symbol
Figure 3.8 - Siemens SIMATIC WinCC flexible | Selecting the “Start_button” symbol

Once done, repeat these operations to create a “Stop_button” tag.

Figure 3.9 - Siemens SIMATIC WinCC flexible | Creating the “Stop_button” tag
Figure 3.9 - Siemens SIMATIC WinCC flexible | Creating the “Stop_button” tag

Repeat them once again to create a “Motor” tag.

Figure 3.10 - Siemens SIMATIC WinCC flexible | Creating the “Motor_1” tag
Figure 3.10 - Siemens SIMATIC WinCC flexible | Creating the “Motor_1” tag

HMI Programming

We have finished all the configuration to be done upstream, we can move on to programming. In this section, we will assemble blocks such as buttons and animated figures to design a dashboard that will allow us to interact with the PLC program and monitor it.

Figure 4.1 - Siemens SIMATIC WinCC flexible | Tools list and programming interface
Figure 4.1 - Siemens SIMATIC WinCC flexible | Tools list and programming interface

For this application, we will use two buttons to turn on and off the motor and a colored circle to indicate the motor’s state. 

Figure 4.2 - Siemens SIMATIC WinCC flexible | Button and circle objects
Figure 4.2 - Siemens SIMATIC WinCC flexible | Button and circle objects

Buttons and events

Let’s first add a button. Select a button element and drag it to the workspace.

Figure 4.3 - Siemens SIMATIC WinCC flexible | Adding a button
Figure 4.3 - Siemens SIMATIC WinCC flexible | Adding a button

Once done, a simple button will appear where you dropped the element.

Figure 4.4 - Siemens SIMATIC WinCC flexible | The button is added
Figure 4.4 - Siemens SIMATIC WinCC flexible | The button is added

After that, you can make the button bigger by selecting it and dragging one of the corner points in the direction you want.

Figure 4.5 - Siemens SIMATIC WinCC flexible | Enlarging the button
Figure 4.5 - Siemens SIMATIC WinCC flexible | Enlarging the button

While the button is selected, its properties will appear in the properties view below. Here you can configure the appearance and behavior of the button.

We will first change the text on the button. Open the General section and click on the “Text OFF” text box.

Figure 4.6 - Siemens SIMATIC WinCC flexible | Changing the button’s text
Figure 4.6 - Siemens SIMATIC WinCC flexible | Changing the button’s text

This button will be used to start the motor. Therefore, type “Start” in the text box.

Figure 4.7 - Siemens SIMATIC WinCC flexible | The text is modified
Figure 4.7 - Siemens SIMATIC WinCC flexible | The text is modified

Next, we need to configure the events that will be triggered by pressing the button. Open the Events section. Here, you will the different types of events available. The event type we need to use is the “Click” which triggers the event when clicking on the button. Once done, you will find the function list where you can define the function that will be executed when triggering the event.

Figure 4.8 - Siemens SIMATIC WinCC flexible | Button’s events
Figure 4.8 - Siemens SIMATIC WinCC flexible | Button’s events

Open the Function list by clicking on the small arrow button. Here, you will find all the different types of functions that can be used. Since we are handling boolean variables in our PLC program, we are going to focus on the “Edit bits” functions.

Figure 4.9 - Siemens SIMATIC WinCC flexible | Event functions list
Figure 4.9 - Siemens SIMATIC WinCC flexible | Event functions list

Open the “Edit bits” section and select the “SetBit” functions.

Figure 4.10 - Siemens SIMATIC WinCC flexible | Selecting the “SetBit” function
Figure 4.10 - Siemens SIMATIC WinCC flexible | Selecting the “SetBit” function

The “SetBit” function is used to set to 1 a boolean tag (variable). It will be used to set the “Start_button” to 1 upon clicking on the button.

Once done, the “SetBit” function is created. We need now to define the tag (variable) associated with this function. By default, no tag is selected.

Figure 4.11 - Siemens SIMATIC WinCC flexible | The function is created
Figure 4.11 - Siemens SIMATIC WinCC flexible | The function is created

To select a tag, click on the small arrow button. This will open a list of all the available tags. Since we are configuring the Start button, we must select the “Start_button” tag.

Figure 4.12 - Siemens SIMATIC WinCC flexible | Selecting the target tag
Figure 4.12 - Siemens SIMATIC WinCC flexible | Selecting the target tag

And we are done configuring the “SetBit” event.

Figure 4.13 - Siemens SIMATIC WinCC flexible | The function is configured
Figure 4.13 - Siemens SIMATIC WinCC flexible | The function is configured

Since we are going to create a second button for stopping the motor, we need to add a second event function that will prevent any conflict between the two buttons. For this, we have to add a “ResetBit” function that will set the tag used in the stop button to 0. This way, both tags cannot be at 1 simultaneously. Repeat the steps for creating an event function to create a "ReseBit" function associated with the "Stop_button" tag.

Figure 4.14 - Siemens SIMATIC WinCC flexible | Adding a second event function
Figure 4.14 - Siemens SIMATIC WinCC flexible | Adding a second event function

After that, repeat all the button creation steps to create a Stop button and configure its events as shown in the following figure.

Figure 4.15 - Siemens SIMATIC WinCC flexible | Adding the “Stop” button
Figure 4.15 - Siemens SIMATIC WinCC flexible | Adding the “Stop” button

The principle of this button is the same as the Start button with the exception that the tags used in the events are inverted: The “SetBit” event sets the “Stop_button” tag to 1 and the “ResetBit” event sets the “Start_button” tag to 0.

Animations

We are done creating and configuring the buttons. Now, in this section of the tutorial, we will create an animated object that will indicate the state of the motor. For this, we will use a circle shape whose color will change depending on the motor state: Green for on and red for off.

First, add a circle object in your workspace.

Figure 4.16 - Siemens SIMATIC WinCC flexible | Adding a circle object
Figure 4.16 - Siemens SIMATIC WinCC flexible | Adding a circle object

Once done, make the circle bigger using its corner points.

Figure 4.17 - Siemens SIMATIC WinCC flexible | The circle is created
Figure 4.17 - Siemens SIMATIC WinCC flexible | The circle is created

After that, in the properties view, open the “Appearance” section. Here, you can configure various animations regarding the object’s appearance. First, we have to enable the appearance animations. Click on the “Enable” checkbox.

Figure 4.18 - Siemens SIMATIC WinCC flexible | Circle’s appearance properties
Figure 4.18 - Siemens SIMATIC WinCC flexible | Circle’s appearance properties

Then, we need to define the tag that will control the animation. Here, it will be the “Motor_1” tag that controls the motor. Click on the small arrow button in the “Tag” section. This will open a list of all the available tags. Select the “Motor_1” tag.

Figure 4.19 - Siemens SIMATIC WinCC flexible | Selecting the animation tag
Figure 4.19 - Siemens SIMATIC WinCC flexible | Selecting the animation tag

Once done, a new value will appear. By default, it is set to the 0 - 100 interval using the integer type. Since we are going to use a boolean tag, we need to use the “Bit” type. In the type section, select the “Bit.” 

Figure 4.20 - Siemens SIMATIC WinCC flexible | Selecting the “Bit” type
Figure 4.20 - Siemens SIMATIC WinCC flexible | Selecting the “Bit” type

After that, click on the “Value” section and change it to 0. This value will be used for the case where the motor is off (Motor_1 tag = 0).

Figure 4.21 - Siemens SIMATIC WinCC flexible | Editing the value
Figure 4.21 - Siemens SIMATIC WinCC flexible | Editing the value

To indicate that the motor is off, we will change the circle’s color to red. Open the “Background Color” section and select the red color.

Figure 4.22 - Siemens SIMATIC WinCC flexible | Selecting the background color
Figure 4.22 - Siemens SIMATIC WinCC flexible | Selecting the background color

With this configuration, when the motor is off, the circle will become red.

Figure 4.23 - Siemens SIMATIC WinCC flexible | The animation’s first case is configured
Figure 4.23 - Siemens SIMATIC WinCC flexible | The animation’s first case is configured

Now, create a new value equal to 1 and use the green color as the background. This way, the circle will become green when the motor is on.

Figure 4.24 - Siemens SIMATIC WinCC flexible | Creating the animation’s second case
Figure 4.24 - Siemens SIMATIC WinCC flexible | Creating the animation’s second case

To indicate that the circle represents the motor’s state, we can add a text label with “Motor” written on it. To do this, grab a “TextField” element and drag it to the circle.

Figure 4.25 - Siemens SIMATIC WinCC flexible | Adding a textfield
Figure 4.25 - Siemens SIMATIC WinCC flexible | Adding a textfield

Open the “General” section of the TextField properties and type “Motor” in the “Text” field.

Figure 4.26 - Siemens SIMATIC WinCC flexible | Modifying the text
Figure 4.26 - Siemens SIMATIC WinCC flexible | Modifying the text

And we are done programming. This dashboard will allow us to interact with the PLC’s motor control application. We can turn on and off the motor the “Start” and “Stop” buttons. And the state of the motor will be indicated using the “Motor” circle’s colors.

Figure 4.27 - Siemens SIMATIC WinCC flexible | The programming is done
Figure 4.27 - Siemens SIMATIC WinCC flexible | The programming is done

Conclusion

In this tutorial, you learned how to navigate and program Siemens's legacy Human-Machine Interfaces (HMIs) using WinCC Flexible. We began by creating a new project, gaining insights into the software's interface, and understanding its essential components. Next, we integrated our HMI project into the SIMATIC Manager, ensuring a seamless connection between the HMI and PLC systems. We then explored the crucial process of configuring connection settings and defining HMI tags, setting the foundation for effective HMI programming. Finally, we delved into the art of programming an interactive HMI dashboard, enabling you to control industrial processes and monitor real-time data.

Moving forward, the next crucial step in the HMI program development is to thoroughly test your application using simulation. Simulation allows you to validate the functionality of your HMI interface without the risk of disrupting real-world industrial processes. Simulating HMI is possible within WinCC Flexible. It is also possible to make it communicate with a simulated PLC using PLCSim. Both of these subjects will be covered in the Simulating Siemens’ legacy PLCs and HMIs tutorial.