Tia Pro1 12 Connecting Hmi

Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

SIMATIC TIA Portal Programming 1

Contents 12

AR
12. Connecting an HMI Device .................................................................................. 12-2
12.1. Task Description: Operating the Plant via the Touchpanel ................................................ 12-3
12.2. Data Exchange between HMI Devices and CPU ................................................................ 12-4
12.3. WinCC Configuration Interface ........................................................................................... 12-5
12.4. Adding an HMI Device ........................................................................................................ 12-6
12.4.1. Configuring the IP Address of an HMI Device .................................................................... 12-7
12.4.2. Networking an HMI Device ................................................................................................. 12-8
12.4.3. Configuring an HMI Connection .......................................................................................... 12-9
12.4.4. Creating HMI Tags and Connecting them with PLC Tags ................................................ 12-11
12.5.
12.5.1.
12.6.
12.7.
12.7.1.
N
I/O Field for Inputting and Outputting Values .................................................................... 12-12
Buttons for Function Execution ......................................................................................... 12-13
Compiling the Configuration.............................................................................................. 12-14
Downloading the Project into the HMI Device .................................................................. 12-15
Requirements for Downloading......................................................................................... 12-16
AI
12.7.2. Exercise 1: Copying the Touchpanel and the Expanded Interface DB into the Project ... 12-17
12.7.3. Exercise 2: Networking the Touchpanel ........................................................................... 12-18
12.7.4. Exercise 3: Configuring the HMI Connection .................................................................... 12-19
12.7.5. Exercise 4: Updating and Completing the HMI Tag Table ............................................... 12-20
12.7.6. Exercise 5: Configuring the SETPOINT Quantity Display ................................................ 12-21
12.7.7. Exercise 6: Compiling and Saving the Touchpanel .......................................................... 12-22
12.7.8. Exercise 7: Adjusting the STEP 7 Program ...................................................................... 12-23
TR

12.7.9. Exercise 8: Downloading the HMI Project and CPU Project ............................................ 12-24
12.8. Additional Information ....................................................................................................... 12-25
12.8.1. HMI Access to Tags / Variables ........................................................................................ 12-26
12.8.2. Manually Setting the Transfer Mode, Transfer Channel and Address.............................. 12-27
SI

TIA-PRO1 - Connecting an HMI Device


Training Document, V16.00.00 12-1
SIMATIC TIA Portal Programming 1

12. Connecting an HMI Device

At the end of the chapter the participant will ...

AR
... be able to explain the principle of data exchange between HMI device
and CPU using tags

... be able to set the interface of the touchpanel

... be able to commission a touchpanel project

… be able to adjust a STEP 7 program

N
AI
TR
SI

TIA-PRO1 - Connecting an HMI Device


12-2 Training Document, V16.00.00
SIMATIC TIA Portal Programming 1

12.1. Task Description: Operating the Plant via the Touchpanel

Operation Off
"S_operationOFF" (NC)

Operation On
Operation
"S_operationON
"P_operation"
"

Jog Right
"S_right"

Jog Left

AR
"S_left"

Conveyor-
Acknowledge fault
Fault
"S_acknowledge"
"P_fault"

Task Description
N
The touchpanel project is to be commissioned and the S7 program of the controller is to be
adjusted in such a way that…
AI
• the functions "Operation ON/OFF" and "Jog Right/Left" are no longer realized via the
simulator switches but via the corresponding buttons on the touchpanel.
• the acknowledgement of a conveyor fault should still be possible via the simulator switch
"S_acknowledge", and, in addition, also via the corresponding button on the touchpanel.
• the SETPOINT quantity is no longer a constant three, but can be preset via an input field on
TR

the touchpanel.
SI

TIA-PRO1 - Connecting an HMI Device


Training Document, V16.00.00 12-3
SIMATIC TIA Portal Programming 1

12.2. Data Exchange between HMI Devices and CPU

Press Button
"Set Bit"
Release Button

AR
"Reset Bit"

PROFIBUS
Industrial Update
Ethernet e.g. every 500ms

Data Exchange between HMI Devices and CPU


N
Data is exchanged between SIMATIC S7 and the HMI system via tags. In the configuration of the
HMI device, the screen objects, such as, buttons and input/output fields are linked to HMI tags
AI
which in turn are connected to PLC tags of the CPU. The HMI system cyclically exchanges the
values between these tags. Data is transferred cyclically between SIMATIC S7 and the HMI
system, that is, process variables are cyclically read and written by the HMI device depending on
the configured update time.

HMI Tags
TR

HMI tags can be connected to the global PLC tags or to the following global data areas of the
CPU:
• Data blocks (DB)
• Memory bits (M)
• Inputs (I) and outputs (Q)
• I/O inputs (PI) and I/O outputs (PQ)
HMI systems also recognize local tags without a link to the PLC, i.e. these tags are exclusively
processed internally and also do not reserve any communication resources whatsoever.
SI

Communication
The operator panels can communicate with the (PLC) controller via the PROFIBUS or Industrial
Ethernet bus systems. The S7 protocol is used for this purpose. Communication is organized by
the operating systems of the S7 CPU and the HMI system. There is no user programming effort
required. An operator panel can also exchange data with several (PLC) controllers.

TIA-PRO1 - Connecting an HMI Device


12-4 Training Document, V16.00.00
SIMATIC TIA Portal Programming 1

12.3. WinCC Configuration Interface

Working area
Toolbox
HMI device such as Buttons,
I/O fields

AR
Details view

Properties
e.g. of a button

Project Window
N
In the Project tree, all devices and their configuration and parameter assignments are displayed
in a tree structure. From there, the relevant editors can be opened. Furthermore, the "language
AI
support" and the "version management" can be found here.

Working Area
This is the central configuration area in which objects of the operator panel are edited with the
started editor. Several editors can be open at the same time.
TR

Properties Window
The properties of selected objects (for example, of screens, screen objects, tags) can be edited in
the Properties window. This window is only available in those editors where object properties
have to be set.

Toolbox Window
The toolbox window contains all configurable objects which can be configured in screens, and
permits access to libraries.
SI

TIA-PRO1 - Connecting an HMI Device


Training Document, V16.00.00 12-5
SIMATIC TIA Portal Programming 1

12.4. Adding an HMI Device

Portal view

A R
N
Project view

Adding an HMI Device

A I
New HMI devices can be added from both the Portal view and the Project view. More than
anything else, attention has to be paid to the device data such as Article number (order number)
and Version number.

T R
S I
TIA-PRO1 - Connecting an HMI Device
12-6 Training Document, V16.00.00
SIMATIC TIA Portal Programming 1

12.4.1. Configuring the IP Address of an HMI Device

AR
Select
interface

PROFINET Interface of the HMI Device


N
Regardless of whether the Hardware and Network editor is in the Devices view or the Network
view, the settings of the PROFINET interface (IP address and subnet mask) can be made in the
AI
"Properties" tab in the Inspector window for a selected HMI device interface.
If an online connection between the HMI device and the CPU is to be established, both devices
must be assigned the same subnet mask and IP addresses that are in the same subnet.
TR
SI

TIA-PRO1 - Connecting an HMI Device


Training Document, V16.00.00 12-7
SIMATIC TIA Portal Programming 1

12.4.2. Networking an HMI Device

AR
Show / Hide
Drag & Drop
address labels

During networking, the device is automatically assigned


an IP address which can be changed in the screen area of
the Network view

Networking HMI Devices


N
During networking, devices are connected to a subnet. The device interface must be compatible
with the type of network.
AI
The devices are networked in the Network view of the Hardware and Network editor under
"Network" by connecting the device interfaces using drag & drop.
TR
SI

TIA-PRO1 - Connecting an HMI Device


12-8 Training Document, V16.00.00
SIMATIC TIA Portal Programming 1

12.4.3. Configuring an HMI Connection

1. Select HMI
connection(s)

AR
2. Use drag & drop to
drag a connection
3. Check
connection

The connection configuration


automatically networks the devices!

Configuring HMI Connections


N
In configuring HMI connection(s), the communications partners are defined with which the HMI
device will later exchange data in the process control phase. The HMI device can also be
AI
connected to or exchange data with several controllers.
There can also be controllers in the same network with which the HMI device does not exchange
data. Then, the HMI device is "networked" with these controllers but it is not "connected".
T R
SI

TIA-PRO1 - Connecting an HMI Device


Training Document, V16.00.00 12-9
SIMATIC TIA Portal Programming 1

12.4.3.1. Checking the Connection and Entering the Password for CPU Accesses

AR
Password for
HMI accesses

Connection:
N
The configured connections are visible in the Connections of the HMI device.
AI
Password Query for HMI Accesses
In order to get access rights to a CPU that is password-protected, the HMI device must log on to
the CPU with the help of the password when Runtime is started. This password must be specified
in the Connections configuration of the HMI device (see picture bottom right).
TR
SI

TIA-PRO1 - Connecting an HMI Device


12-10 Training Document, V16.00.00
SIMATIC TIA Portal Programming 1

12.4.4. Creating HMI Tags and Connecting them with PLC Tags

The connection of tags automatically networks the


devices and configures a connection!

AR
N
In the HMI tags folder, the HMI tags can be created and they can be connected with the
associated PLC tags via an existing connection. The properties, such as, Access mode,
Acquisition cycle etc., can be defined.
AI
TR
SI

TIA-PRO1 - Connecting an HMI Device


Training Document, V16.00.00 12-11
SIMATIC TIA Portal Programming 1

12.5. I/O Field for Inputting and Outputting Values

AR
PLC tag

Mode

I/O Fields
N
The values of tags are displayed via output fields; the values of tags can also be preset via input
fields. The mode can be set in the Properties window.
AI
Mode
Output
The value of the tags is only displayed. The tag is read and updated in the interval of the
configured acquisition cycle.
A value change (input) on the operator panel is not possible.
TR

Input/Output
The value of the tags is displayed. The tag is read and updated in the interval of the configured
acquisition cycle.
A value change (input) on the operator panel is possible – on touch displays, using the
automatically displayed Display (screen) keyboard, and, with key devices, using the device
keyboard.

Note:
I/O fields can also be generated by dragging & dropping a tag directly from a tag table or a data
SI

block (also via the Details view). In so doing, an HMI tag is automatically created which is
connected via an existing connection to the PLC tag.

TIA-PRO1 - Connecting an HMI Device


12-12 Training Document, V16.00.00
SIMATIC TIA Portal Programming 1

12.5.1. Buttons for Function Execution

AR
Operating events
of the button
PLC tag

Actions when
operating the The selection of a PLC tag in Properties creates the necessary HMI
button tag, automatically networks the devices and configures a connection!

Buttons
N
System functions can be initiated by the operator via buttons, such as, the selection of a screen
or the setting and resetting of a tag shown in the screen. Under "Events", you specify for which
AI
event which system function is to be executed.
TR
SI

TIA-PRO1 - Connecting an HMI Device


Training Document, V16.00.00 12-13
SIMATIC TIA Portal Programming 1

12.6. Compiling the Configuration

Compile
(Delta generation)

AR
Compile (only changes)
N
Here, all changes since the last generation are regenerated.
AI
→ Delta generation

Software/Hardware (rebuild all blocks)


Regenerates the entire operator panel

When is a ‘Rebuild all blocks’ necessary?


TR

When correctly configured functions are not correctly executed or are not executed at all.
When error messages occur during compiling that are not "correct".
SI

TIA-PRO1 - Connecting an HMI Device


12-14 Training Document, V16.00.00
SIMATIC TIA Portal Programming 1

12.7. Downloading the Project into the HMI Device

AR
N
Downloading the Project into the HMI Device
When you transfer an HMI project to one or more operator panels, the part of the project that has
been changed since the last transfer is automatically compiled before downloading. This ensures
AI
that the current project status is always transferred. Beyond that, it is also possible to activate the
option "Overwrite all" before loading starts.
For commissioning, the project should be completely compiled using the command "Compile >
Software (rebuild all blocks)" in the context menu of the operator panel. If HMI tags that are
connected to PLC tags are also used in the project, all modified STEP 7 blocks should also be
compiled using the command "Compile > Software" in the context menu and then be downloaded
TR

into the CPU.


In order to reduce the time required for compiling delta data in current engineering sessions, it is
also recommended that you occasionally use the "Compile > Software (rebuild all blocks)"
command.
SI

TIA-PRO1 - Connecting an HMI Device


Training Document, V16.00.00 12-15
SIMATIC TIA Portal Programming 1

12.7.1. Requirements for Downloading

Device version

• Configured device type is identical


to the target device type

• Connection to the target device


exists

AR
• Target device is ready to load
(transfer mode active)

• Project is compiled without errors “Transfer” must be activated in


 may contain warnings the Start Center for
downloading
• Online settings in TIA Portal match
the connection Runtime is automatically
stopped during the download

Device Type and Device Version on the Operator Panel


N
The device type can be found on the nameplate of the operator panel.
The Image version is displayed in the Start Center when the device is started.
AI
Caution: Updating the device version or the Image version can lead to the loss of recipe
data, user data and some system settings.

Connection to the Target Device


A direct connection can be tested via "Update accessible devices" in the "Online access".
A direct connection for Ethernet can also be checked via the network connection test
TR

"ping xxx.xxx.xxx.xxx" (xxx.xxx.xxx.xxx = IP address).

Transfer Readiness
Two conditions must be fulfilled on the operator panel for the Transfer to panels:
• The connection is actually activated for the Transfer (Settings for the Transfer)
• The operator panel is in the "Transfer mode"
a) Transfer mode "Automatic" and Runtime is started or
SI

b) Transfer mode "Manual" and Transfer is activated in the Start Center

Generating the Project without Errors


During generation, problems can arise in two categories.

• Warning - Project is useable but incomplete (!!!)

• Error(s) - Generation is aborted.

Online Settings
Depending on the device connection, the settings in the dialog "Extended download to device"
must also match the current connection and the transfer readiness of the operator panel.

TIA-PRO1 - Connecting an HMI Device


12-16 Training Document, V16.00.00
SIMATIC TIA Portal Programming 1

12.7.2. Exercise 1: Copying the Touchpanel and the Expanded Interface DB into
the Project

AR
Task
N
AI
Up until now, your project doesn’t contain an HMI device. Instead of a completely new
configuration, you are to copy an already configured Panel and the data block "InterfaceTP" that
is to serve as the interface between the controller and the touchpanel, from the global library
"PRO1_V160000" into your project.

What to Do
1. Open the global library C:\_Archive\TIA-PRO1_V160000\PRO1_V160000.
TR

2. Using drag & drop, copy the library element "InterfaceTP" from the "Chapter12" folder into
your project (see picture) and, in the dialog that appears, confirm that objects that already
exist in the project are to be overwritten.
SI

3. Using drag & drop, copy the library element "Touchpanel" into your project (see picture).
4. Save your project.

TIA-PRO1 - Connecting an HMI Device


Training Document, V16.00.00 12-17
SIMATIC TIA Portal Programming 1

12.7.3. Exercise 2: Networking the Touchpanel

Show address
Drag & Drop labels

AR
Set IP address

Task
N
The added touchpanel is to be networked with the CPU via Ethernet.
AI
What to Do
1. In the Project tree, start the Hardware and Network editor, switch to the "Network view" and
there select "Network".
2. Position the mouse pointer on the small green square (Ethernet interface) of the CPU and,
while keeping the left mouse button pressed down, drag a connection to the small green
square (Ethernet interface) of the HMI device. The network is created; the associated subnet
TR

and the parameters appropriate for the network (IP address and subnet mask) are
automatically created.
3. With the help of the “Show address labels” button, show the IP addresses, check the IP
addresses of the CPU (192.168.111.102) and the touchpanel (192.168.111.101) and, if
necessary, correct these.
This can be set directly at the shown address or also via the Properties of the devices in the
Inspector window.
SI

4. In the Network view, the interfaces of the CPU and the touchpanel should be connected with
the same subnet.

TIA-PRO1 - Connecting an HMI Device


12-18 Training Document, V16.00.00
SIMATIC TIA Portal Programming 1

12.7.4. Exercise 3: Configuring the HMI Connection

1. Select HMI
connection(s)

2. Use drag & drop


to drag a connection

AR
3. Check the
connection

Task
N
After the TP has been networked with the Ethernet network, an HMI connection between the
touchpanel and the CPU must be created.
AI
What to Do
1. In the Network view, switch from "Network" to "Connections" and there select "HMI
connection" (see picture).
2. Position the mouse pointer on the small green square of the HMI device and, while keeping
the left mouse button pressed down, drag a connection to the CPU.
TR

The connection is created and given the default name. You can keep the name of the
connection.
3. In the Details window in the "Connections" tab, check whether the HMI connection was
correctly created (see picture).

You must also be able to see the connection in the "Connections" folder of the touchpanel.

If, in the graphic area, only the network(ing) and not the type of connection between the S7-
CPU and the HMI device is displayed, then position the mouse pointer on the network and, in
the dialog window that appears, select the connection or double-click on the connection in the
SI

tabular area.
4. Save your project.

TIA-PRO1 - Connecting an HMI Device


Training Document, V16.00.00 12-19
SIMATIC TIA Portal Programming 1

12.7.5. Exercise 4: Updating and Completing the HMI Tag Table

AR
Task
N
The HMI tags "P_operation" and "Interface_actualValue" are not yet connected to PLC tags; in
addition, the connections are highlighted in red. Your task is now to supplement missing tag
AI
connections and to correct faulty connections.

What to Do
1. Open the table "Default tag table" in the HMI tags folder of the touchpanel.
2. If errors are displayed (highlighted in red) in the column ‘Connection’, then correct the
connection in the first line by selecting the existing connection.
TR

3. Adopt the connection of the corrected tag for all other tags by selecting (highlighting) the tag
connection, clicking on the lower right corner of the cell and, while keeping the left mouse
button pressed down, dragging it over all other cells (familiar Excel function). Confirm the
"Autocompletion" dialog that follows with the selection "Overwrite Tag attributes".
4. Connect the HMI tags that are not yet connected to the corresponding PLC tags. Proceed as
shown in the picture.
5. Save your project.
SI

TIA-PRO1 - Connecting an HMI Device


12-20 Training Document, V16.00.00
SIMATIC TIA Portal Programming 1

12.7.6. Exercise 5: Configuring the SETPOINT Quantity Display

AR
Split editor

Task
N
Up until now, the SETPOINT quantity of the parts to be transported was preset with the value 3
via the tag "InterfaceTP".setpoint. Now, you should be able to preset the SETPOINT quantity via
AI
an input field on the touchpanel instead. For that, an additional input/output field must be
configured in the "11_Conveyor" screen (see picture)

What to Do
1. Close all objects that are open in the Editor.
2. Open the "InterfaceTP" data block in which the setpoint quantity is stored.
TR

3. As well, open the "11_Conveyor" screen in the "Screens > Application > ApplicationName"
folder of the Touchpanel.
4. Split the Editor area in two.
5. Configure the input field for specifying the setpoint quantity by dragging the "setpoint" tag
from the "InterfaceTP" data block into the screen using drag & drop.
6. Select the newly created input/output field and in the Inspector window in "Properties >
General > Format" set the "Format pattern" (three digits). You can adjust how everything
looks in the menus "Appearance" and "Text format".
SI

TIA-PRO1 - Connecting an HMI Device


Training Document, V16.00.00 12-21
SIMATIC TIA Portal Programming 1

12.7.7. Exercise 6: Compiling and Saving the Touchpanel

2. Save project übersetzen


1. Compile HMI
1. HMI-Projekt

AR
project

Task
N
You are to compile and save the now complete HMI project.
AI
What to Do
1. Compile the HMI project by selecting the touchpanel in the Project tree and then clicking on
the "Compile" button (see picture).
2. In the Inspector window under "Info", read the results of the compilation and eliminate any
errors which may have occurred.
TR

3. Save your project.


SI

TIA-PRO1 - Connecting an HMI Device


12-22 Training Document, V16.00.00
SIMATIC TIA Portal Programming 1

12.7.8. Exercise 7: Adjusting the STEP 7 Program

Operation OFF
"S_operationOFF" (NC)

Operation ON Operation
"S_operationON" "P_operation"

Jog Right
"S_right"

AR
Jog Left
"S_left"

OLD NEW

!!!

Task
N
The S7 program of the controller is to be adjusted in such a way that …
AI
• the functions "Operation ON/OFF" and "Jog Right/Left" are no longer realized via the
simulator switches but via the corresponding buttons on the touchpanel.
• the acknowledgement of errors and faults should still be possible via the simulator switch
"S_acknowledge" (%I0.7), and, in addition, also via the corresponding button on the
touchpanel.

What to Do
R

1. In the function "Mode", replace the variables "S_operationON" (%I0.1) and "S_operationOFF"
(%I0.0) with the corresponding DB tags (see picture). Remember to also take into account
that a hardware-based NC contact is connected to "S_operationOFF"
(%I0.0) and when pressing the "Plant OFF" button, a "TRUE" signal is sent.
T

2. Expand the function "Fault" in such a way that all error and fault acknowledgements which
were possible up until now via "S_acknowledge" (%I0.7), are now additionally possible via the
touchpanel, that is, the DB tag "InterfaceTP".acknowledgeFault.
3. In the function "Conveyor", replace the variables "S_right" (%I0.2) and "S_left" (%I0.3) with
SI

the corresponding DB tags.


4. Compile and save your program.

TIA-PRO1 - Connecting an HMI Device


Training Document, V16.00.00 12-23
SIMATIC TIA Portal Programming 1

12.7.9. Exercise 8: Downloading the HMI Project and CPU Project

A R
Task

I N
From the project, all modified S7 blocks are to be transferred into the CPU and the entire Panel

A
project is to be transferred into the touchpanel.

What to Do
1. Download all S7 blocks into the CPU.
2. Download the Panel project into the touchpanel

R
(It is possible that the Transfer conditions have to be controlled and set.)
3. Carry out a function test by
− Switching the operating mode via the touchpanel.

T
− Jogging the conveyor model to the right and left with the help of the touchpanel while in
Manual mode (Plant OFF).

I
− Presetting a SETPOINT quantity and starting the part transportation while in Automatic
mode (Plant ON),
− Monitoring how the ACTUAL quantity is updated.
− Causing a conveyor fault, monitoring its display on the touchpanel and acknowledging it on

S
the touchpanel.
4. Correct – if necessary – your program and check the functions once more.
5. Save your project.

TIA-PRO1 - Connecting an HMI Device


12-24 Training Document, V16.00.00
SIMATIC TIA Portal Programming 1

12.8. Additional Information

AR
Note
N
The following pages contain either further information or are for reference to complete a
topic.
AI
For more in-depth study we offer advanced courses and self-learning mediums.
TR
SI

TIA-PRO1 - Connecting an HMI Device


Training Document, V16.00.00 12-25
SIMATIC TIA Portal Programming 1

12.8.1. HMI Access to Tags / Variables

PLC tags or DB variables

AR
HMI tags

All tags/variables are displayed


Regardless of Accessible, Writeable or Visible

HMI Tag Access


N
In the PLC tag tables and data blocks, protective mechanisms can be declared with whose help
unwanted accesses to PLC tags and DB variables from HMI devices or OPC UA-Clients can be
AI
prevented:
• "Visible in HMI Engineering":
During HMI configuration, only tags/variables with the attribute "Visible in HMI Engineering"
can be selected. This filter function can, however, be disabled in the selection dialog shown
by activating "Show all".
• "Writable from HMI/OPC UA" (only S7-1200 and S7-1500):
TR

This indicates whether the tag/variable can be written from HMI / OPC UA at runtime. This
protective function integrated in the S7-1200/1500 operating system ensures that the HMI
device or OPC UA-Client does not overwrite certain tags/variables.
• "Accessible from HMI/OPC UA" (only S7-1200 and S7-1500):
The HMI device can only access online the tags/variables which have the attribute
"Accessible from HMI/OPC UA". This protective function integrated in the S7-1200/1500
operating system ensures that the HMI device or OPC UA-Client can neither read-access nor
write-access certain tags/variables. Tags/variables which are not "Accessible from HMI/OPC
UA", accordingly are also not "Visible in HMI Engineering".
SI

Note:
OPC UA is a standard which enables an operating system-independent and platform-
independent data exchange.

TIA-PRO1 - Connecting an HMI Device


12-26 Training Document, V16.00.00
SIMATIC TIA Portal Programming 1

12.8.2. Manually Setting the Transfer Mode, Transfer Channel and Address

AR
N
Manually Setting the Transfer Mode, the Transfer Channel and the Address of a Panel
You can manually set the Transfer mode, the interface as well as the relevant address of the
panel via "Start Center > Settings >Transfer".
AI
TR
SI

TIA-PRO1 - Connecting an HMI Device


Training Document, V16.00.00 12-27

You might also like