Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional /...

47
Toolbox for HMI Projects (WinCC V7.4 SP1) WinCC V7.4 SP1, SIMATIC S7-1500 https://support.industry.siemens.com/cs/ww/en/view/109749914 Siemens Industry Online Support

Transcript of Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional /...

Page 1: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

Toolbox for HMI Projects (WinCC V7.4 SP1)

WinCC V7.4 SP1, SIMATIC S7-1500

https://support.industry.siemens.com/cs/ww/en/view/109749914

Siemens Industry Online Support

Page 2: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

Warranty and Liability

Toolbox Entry ID: 109749914, V1.0, 09/2017 2

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

Warranty and Liability

Note The Application Examples are not binding and do not claim to be complete regarding the circuits shown, equipping and any eventuality. The Application Examples do not represent customer-specific solutions. They are only intended to provide support for typical applications. You are responsible for ensuring that the described products are used correctly. These Application Examples do not relieve you of the responsibility to use safe practices in application, installation, operation and maintenance. When using these Application Examples, you recognize that we cannot be made liable for any damage/claims beyond the liability clause described. We reserve the right to make changes to these Application Examples at any time without prior notice. If there are any deviations between the recommendations provided in these Application Examples and other Siemens publications – e.g. Catalogs – the contents of the other documents have priority.

We do not accept any liability for the information contained in this document. Any claims against us – based on whatever legal reason – resulting from the use of the examples, information, programs, engineering and performance data etc., described in this Application Example shall be excluded. Such an exclusion shall not apply in the case of mandatory liability, e.g. under the German Product Liability Act (“Produkthaftungsgesetz”), in case of intent, gross negligence, or injury of life, body or health, guarantee for the quality of a product, fraudulent concealment of a deficiency or breach of a condition which goes to the root of the contract (“wesentliche Vertragspflichten”). The damages for a breach of a substantial contractual obligation are, however, limited to the foreseeable damage, typical for the type of contract, except in the event of intent or gross negligence or injury to life, body or health. The above provisions do not imply a change of the burden of proof to your detriment. Any form of duplication or distribution of these Application Examples or excerpts hereof is prohibited without the expressed consent of the Siemens AG.

Security informa-tion

Siemens provides products and solutions with industrial security functions that support the secure operation of plants, systems, machines and networks. In order to protect plants, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art industrial security concept. Siemens’ products and solutions only form one element of such a concept. Customer is responsible to prevent unauthorized access to its plants, systems, machines and networks. Systems, machines and components should only be connected to the enterprise network or the internet if and to the extent necessary and with appropriate security measures (e.g. use of firewalls and network segmentation) in place. Additionally, Siemens’ guidance on appropriate security measures should be taken into account. For more information about industrial security, please visit http://www.siemens.com/industrialsecurity.

Siemens’ products and solutions undergo continuous development to make them more secure. Siemens strongly recommends to apply product updates as soon as available and to always use the latest product versions. Use of product versions that are no longer supported, and failure to apply latest updates may increase customer’s exposure to cyber threats. To stay informed about product updates, subscribe to the Siemens Industrial Security RSS Feed under http://www.siemens.com/industrialsecurity.

Page 3: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

Table of Contents

Toolbox Entry ID: 109749914, V1.0, 09/2017 3

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

Table of Contents Warranty and Liability ................................................................................................. 2

1 Introduction ........................................................................................................ 4

2 Alarm ................................................................................................................... 5

2.1 Solution................................................................................................. 5 2.1.1 Description ........................................................................................... 5 2.1.2 Hardware and software components ................................................... 5 2.1.3 Data types and function blocks used ................................................... 6 2.2 Configuration ........................................................................................ 7 2.2.1 Controller .............................................................................................. 7 2.2.2 HMI ....................................................................................................... 9 2.3 Operation ............................................................................................ 16

3 Stopwatch ......................................................................................................... 17

3.1 Solution............................................................................................... 17 3.1.1 Description ......................................................................................... 17 3.1.2 Hardware and software components ................................................. 17 3.1.3 Data types and function blocks used ................................................. 18 3.2 Configuration ...................................................................................... 19 3.2.1 Controller ............................................................................................ 19 3.2.2 HMI ..................................................................................................... 21 3.3 Operation ............................................................................................ 30

4 Timer ................................................................................................................. 32

4.1 Solution............................................................................................... 32 4.1.1 Description ......................................................................................... 32 4.1.2 Hardware and software components ................................................. 32 4.1.3 Data types and function blocks used ................................................. 33 4.2 Configuration ...................................................................................... 34 4.2.1 Controller ............................................................................................ 34 4.2.2 HMI ..................................................................................................... 36 4.3 Operation ............................................................................................ 43

5 Error Handling .................................................................................................. 44

6 Valuable Information ....................................................................................... 45

7 Annex ................................................................................................................ 46

7.1 Service and support ........................................................................... 46 7.2 Links and literature ............................................................................. 47 7.3 Change documentation ...................................................................... 47

Page 4: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

1 Introduction

Toolbox Entry ID: 109749914, V1.0, 09/2017 4

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

1 Introduction

The HMI Toolbox of the Siemens Industry Online Support provides a variety of useful tools that makes your everyday work easier.

The HMI Toolbox comprises tools for the subject areas:

Time functions

Each subject area has its own documentation. Additionally, there is an example projects available that shows how to use the tools.

Application example

"Example project for WinCC V7.4"

Was created with STEP 7 Professional / WinCC Advanced V7.4. A PC station with WinCC V7.4 and an S715163 PN/DP as controller was used as HMI operator panel.

This document describes the functioning and implementation of the tools for the "Time functions" subject area.

The "Time functions" subject area comprises three different tools:

Alarm

Stopwatch

Timer

Page 5: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

2 Alarm

Toolbox Entry ID: 109749914, V1.0, 09/2017 5

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

2 Alarm

2.1 Solution

2.1.1 Description

With the alarm you can be reminded of a certain event via a screen in Runtime at a fixed point in time.

The time (hh:mm:ss) is entered via three I/O fields directly in the screen. Actuate the button to enable the alarm.

The controller compares the current time with the time of the alarm and triggers an alarm when the set time is reached.

In the status bar you can see when the alarm expires. Click on the status bar to acknowledge the alarm.

Figure 2-1

2.1.2 Hardware and software components

This application example is valid for:

SIMATIC S7-1500

WinCC V7.4 SP1

STEP 7 V14 SP1

Page 6: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

2 Alarm

Toolbox Entry ID: 109749914, V1.0, 09/2017 6

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

2.1.3 Data types and function blocks used

FC "LGF_DTL_toString"

The "LGF_DTLtoString" function block is taken from the "Library of general functions (LGF) for STEP 7 (TIA Portal) and S7-1500". This block converts a date component of the DTL data type into a character string of the string format.

Further information on this function block is available in the following entry ID 109479728.

FB "LHmiTime_Alarm"

The "LHmiTime_Alarm" function block compares the embedded alarm time with the system time. If both match, the function block sets an "elapsed" alarm status and returns the time "elapsedTime" if an error occurs.

Figure 2-2LHmiTime_Alarm

LHmiTime_Alarm

Int

hour elapsed

Bool

Int

minute elapsedTime

String

Int

second

Bool

reset

Bool state

Bool

Table 2-1: Parameter of LHmiTime_Alarm

Name P type Data type Comment

hour IN Int

minute IN Int

second IN Int

reset IN Bool

elapsed OUT Bool

elapsedTime OUT String

state IN_OUT Bool

Page 7: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

2 Alarm

Toolbox Entry ID: 109749914, V1.0, 09/2017 7

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

2.2 Configuration

2.2.1 Controller

Table 2-2

No. Action

1. Download the "109749914_LHmiTime_LIB_V14.zip" library and unzip the file.

2. Open your STEP 7 configuration.

Open the "Global libraries" tab in the "Libraries" task card.

3. Click the second icon from the left to open "Global library".

4. Select the "109749914_LHmiTime_LIB_V14.al14" file and click the "Open" button to open the library.

5. Open the "Master copies" folder of the library. Drag the "LHmiTime_CommDB" data block into the "Program blocks" folder of your controller.

All tags that are required for the alarm have the prefix "alarm". Delete all other tags from the "LHmiTime_CommDB" data block.

6. Open the "Types" folder of the library and drag the function block "LGF_DTLtoString" and "LHmiTime_Alarm" to your controller.

Note

You only require the "LGF_DTLtoString" function block if it is not yet integrated in your project.

Page 8: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

2 Alarm

Toolbox Entry ID: 109749914, V1.0, 09/2017 8

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

No. Action

7. Call the "LHmiTime_Alarm" function block in your user program and interconnect the inputs and outputs with the appropriate tags of the communication DB.

8. Compile the project and load it into the controller.

Page 9: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

2 Alarm

Toolbox Entry ID: 109749914, V1.0, 09/2017 9

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

2.2.2 HMI

Connection to controller

Table 2-3

No. Action

1. Open the tag management in WinCC.

2. Add a "SIMATIC S7-1200, S7-1500 Channel" as new driver.

3. Create a "New Connection".

Page 10: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

2 Alarm

Toolbox Entry ID: 109749914, V1.0, 09/2017 10

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

No. Action

4. Open the connection parameters.

5. Enter the IP address into your controller.

6. Start Runtime.

Page 11: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

2 Alarm

Toolbox Entry ID: 109749914, V1.0, 09/2017 11

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

No. Action

7. Click the "Read from AS" button.

8. Load the following tags from the controller.

Name Data type

alarmElapsed Bool

alarmReset Bool

alarmState Bool

alarmHour Short

alarmMinute Short

alarmElapsedTime String

alarmSecond Short

Page 12: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

2 Alarm

Toolbox Entry ID: 109749914, V1.0, 09/2017 12

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

Graphics Designer

Table 2-4

No. Action

1. Open the Graphics Designer.

2. Create an "Alarm" screen.

3. Drag the 3 I/O fields into the screen.

4. Connect each I/O field with the transferred tag

(Hour "LHmiTime_CommDB_alarmHour"

Minute "LHmiTime_CommDB_alarmMinute"

Second "LHmiTime_CommDB_alarmSecond")

from the controller.

Adjust the "output format" from 999.999 to 999. This means that no decimal points are displayed in the I/O field.

5. Add 2 round buttons into the screen.

Page 13: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

2 Alarm

Toolbox Entry ID: 109749914, V1.0, 09/2017 13

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

No. Action

6. The round button "On" sets the "LHmiTime_CommDB_alarmState" tag to TRUE.

The round button “Off" sets the "LHmiTime_CommDB_alarmState" tag to FALSE.

Page 14: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

2 Alarm

Toolbox Entry ID: 109749914, V1.0, 09/2017 14

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

No. Action

7. The buttons "On" and "Off" should be shown alternately of the "LHmiTime_CommDB_alarmState" state. Configure the visibility of the individual elements in the "Display" properties. To do this, call the dynamic dialog in the "Display" properties. Configure the dialog in a way that the "LHmiTime_CommDB_alarmState" tag is only visible if the value is TRUE.

8. Add an I/O field. Connect the I/O field via the configuration dialog using the "LHmiTime_CommDB_alarmElapsedTime" tag. Set the data format to string. Additionally, add a rectangle and a static text "Alarm expired at".

Page 15: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

2 Alarm

Toolbox Entry ID: 109749914, V1.0, 09/2017 15

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

No. Action

9. The I/O field, the rectangle and the static text are only to be displayed when an alarm is triggered. Configure the visibility of the individual elements in the "Display" properties. To do this, call the dynamic dialog in the "Display" properties. Configure the dialog in a way that the "LHmiTime_CommDB_alarmElapsed" tag is only visible if the value is TRUE.

10. The alarm is acknowledged by configuring a signal edge for the resetting the timer on the "LHmiTime_CommDB_alarmReset" tag. To do this, click “Alarm expired at:" to set the value of the tag from TRUE to FALSE.

Page 16: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

2 Alarm

Toolbox Entry ID: 109749914, V1.0, 09/2017 16

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

2.3 Operation

Table 2-5

No. Action

1. Download the example project and unzip the file.

2. Open the controller project in the TIA Portal. Load the controller project into your controller.

3. Open the visualization project in WinCC V7.4. Start Runtime.

4. Click the "Time functions" button.

Open the "Alarm" button.

5. Enter the time when you want the alarm to be displayed. Enable the alarm via the "Start" button.

6. Click on the "Alarm expired at:" button to acknowledge the alarm.

Page 17: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

3 Stopwatch

Toolbox Entry ID: 109749914, V1.0, 09/2017 17

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

3 Stopwatch

3.1 Solution

3.1.1 Description

You can monitor and record the duration of your plant’s production steps, using the stopwatch.

The stopwatch is started via the "START" button and stopped via the "STOP" button. The controller takes on the calculation of the rounds.

The stopwatch can save up to 5 rounds and output them on your HMI operator panel. The rounds are recorded, using the "Round" button. Once five rounds have been recorded, the stopwatch stops. You can reset the times for stop and rounds, using the "RESET" button.

Figure 3-1

3.1.2 Hardware and software components

SIMATIC S7-1500

WinCC V7.4 SP1

STEP 7 V14 SP1

Page 18: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

3 Stopwatch

Toolbox Entry ID: 109749914, V1.0, 09/2017 18

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

3.1.3 Data types and function blocks used

"typeRound” data type

The "typeRound" data type defines the stop/rounds as "Time" data format as well as the appropriate number of the minutes and seconds.

Table 3-1

Name Data type Comment

time Time Total time

min Int Number of minutes

sec Int Number of seconds

FB "LHmiTime_Stopwatch"

The "LHmiTime_Stopwatch" function block starts an internal timer that calculates the "total" stop time as well as the individual rounds ("round1" – "round5").

Figure 3-2LHmiTime_Stopwatch

LHmiTime_Stopwatch

Bool

round enableReset

Bool

Bool

reset

"typeRound" total

"typeRound"

"typeRound" round1

"typeRound"

"typeRound" round2

"typeRound"

"typeRound" round3

"typeRound"

"typeRound" round4

"typeRound"

"typeRound" round5

"typeRound"

Bool start

Bool

Table 3-2: Parameter of LHmiTime_Stopwatch

Name P type Data type Comment

round IN Bool

reset IN Bool

enableReset OUT Bool

total IN_OUT "typeRound"

round1 IN_OUT "typeRound"

round2 IN_OUT "typeRound"

round3 IN_OUT "typeRound"

round4 IN_OUT "typeRound"

round5 IN_OUT "typeRound"

start IN_OUT Bool

Page 19: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

3 Stopwatch

Toolbox Entry ID: 109749914, V1.0, 09/2017 19

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

3.2 Configuration

3.2.1 Controller

Table 3-3

No. Action

1. Download the "109749914_LHmiTime_LIB_V14.zip" library and unzip the file.

2. Open your STEP 7 configuration.

Open the "Global libraries" tab in the "Libraries" task card.

3. Click the second icon from the left to open a global library.

4. Select the "109749914_LHmiTime_LIB_V14.al14" file and click the "Open" button to open the library.

5. Open the "Master copies" folder of the library. Drag the "LHmiTime_CommDB" data block into the "Program blocks" folder of your controller.

All tags that are required for the stopwatch have the prefix "stopWatch". Delete all other tags from the "LHmiTime_CommDB" data block.

6. Open the "Types" folder of the library and drag the function block "LHmiTime_Stopwatch", "LHmiTime_TimeToMinSec" and "typeRound" to your controller.

Note

You only require the "LGF_DTLtoString" function block if it is not yet integrated in your project.

Page 20: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

3 Stopwatch

Toolbox Entry ID: 109749914, V1.0, 09/2017 20

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

No. Action

7. Call the "LHmiTime_Stopwatch" function block in your user program and interconnect the inputs and outputs with the appropriate tags of the communication DB.

8. Compile the project and load it into the controller.

Page 21: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

3 Stopwatch

Toolbox Entry ID: 109749914, V1.0, 09/2017 21

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

3.2.2 HMI

Connection to controller

Table 3-4

No. Action

1. Open the tag management in WinCC.

2. Add a "SIMATIC S7-1200, S7-1500 Channel" as new driver.

3. Create a "New Connection".

Page 22: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

3 Stopwatch

Toolbox Entry ID: 109749914, V1.0, 09/2017 22

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

No. Action

4. Open the connection parameters.

5. Enter the IP address of your controller.

6. Start Runtime.

Page 23: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

3 Stopwatch

Toolbox Entry ID: 109749914, V1.0, 09/2017 23

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

No. Action

7. Click the "Read from AS" button.

Page 24: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

3 Stopwatch

Toolbox Entry ID: 109749914, V1.0, 09/2017 24

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

No. Action

8. Load the following tags from the controller.

Name Data type

stopWatchBusy Bool

stopWatchReset Bool

stopWatchRound Bool

stopWatchStart Bool

stopWatchRound1.min Short

stopWatchRound1.sec Short

stopWatchRound2.min Short

stopWatchRound2.sec Short

stopWatchRound3.min Short

stopWatchRound3.sec Short

stopWatchRound4.min Short

stopWatchRound4.sec Short

stopWatchRound5.min Short

stopWatchRound5.sec Short

stopWatchTotal.min Short

stopWatchTotal.sec Short

Page 25: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

3 Stopwatch

Toolbox Entry ID: 109749914, V1.0, 09/2017 25

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

Graphics Designer

Table 3-5

No. Action

1. Open the Graphics Designer.

2. Create a "Stopwatch" screen.

3. Add 2 I/O fields. They displays the minutes and seconds of the stopwatch. Connect the I/O fields with the tags "LHmiTime_CommDB_stopWatchTotal_min" and "LHmiTime_CommDB_stopWatchTotal_sec".

Page 26: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

3 Stopwatch

Toolbox Entry ID: 109749914, V1.0, 09/2017 26

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

No. Action

4. Add 10 I/O fields. They display the minutes and seconds of the individual rounds. Connect the I/O fields with the tags

LHmiTime_CommDB_stopWatchRound1_min",

LHmiTime_CommDB_stopWatchRound1_sec",

LHmiTime_CommDB_stopWatchRound2_min",

LHmiTime_CommDB_stopWatchRound2_sec",

LHmiTime_CommDB_stopWatchRound3_min",

LHmiTime_CommDB_stopWatchRound3_sec",

LHmiTime_CommDB_stopWatchRound4_min",

LHmiTime_CommDB_stopWatchRound4_sec",

LHmiTime_CommDB_stopWatchRound5_min",

LHmiTime_CommDB_stopWatchRound5_sec".

5. Add 4 round buttons "START", "STOP", "RESET" and "Round" into your screen.

Page 27: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

3 Stopwatch

Toolbox Entry ID: 109749914, V1.0, 09/2017 27

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

No. Action

6. The round button "Start" sets the "LHmiTime_CommDB_stopWatchStart" tag to TRUE.

The round button "STOP" sets the "LHmiTime_CommDB_stopWatchStart" tag to FALSE.

7. The buttons "START" and "STOP" should be shown alternately of the "LHmiTime_CommDB_stopWatchStart" state. Configure the visibility of the individual elements in the "Display" properties. To do this, call the dynamic dialog in the "Display" properties. Configure the dialog in a way that the "LHmiTime_CommDB_alarmState" tag is only visible if the value is FALSE.

Page 28: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

3 Stopwatch

Toolbox Entry ID: 109749914, V1.0, 09/2017 28

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

No. Action

8. The stopwatch is reset by configuring a signal edge for resetting the timer on the "LHmiTime_CommDB_stopWatchReset" tag. To do this, click “Alarm expired at:" to set the value of the tag from TRUE to FALSE.

9. The round button "RESET" is to be visible as long as bit "LHmiTime_CommDB_stopWatchBusy" is shown. To do this, call the dynamic dialog in the "Display" properties. Configure the dialog in a way that the "LHmiTime_CommDB_stopWatchBusy" tag is only visible if the value is TRUE.

Page 29: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

3 Stopwatch

Toolbox Entry ID: 109749914, V1.0, 09/2017 29

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

No. Action

10. The rounds of the stopwatch are recorded by configuring a signal edge to stop the rounds. To do this, by clicking the "LHmiTime_CommDB_stopWatchRound" tag, the value is set from TRUE to FALSE.

11. The round button "Round" is to be visible as long as bit "LHmiTime_CommDB_stopWatchStart" is shown. To do this, call the dynamic dialog in the "Display" properties. Configure the dialog in a way that the "LHmiTime_CommDB_stopWatchStart" tag is only visible if the value is TRUE.

Page 30: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

3 Stopwatch

Toolbox Entry ID: 109749914, V1.0, 09/2017 30

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

3.3 Operation

Table 3-6

No. Action

1. Download the example project and unzip the file.

2. Open the controller project in the TIA Portal. Load the controller project into your controller.

3. Open the visualization project in WinCC V7.4. Start Runtime.

4. Click the "Time functions" button.

Open the "Stopwatch" button.

5. Use the "Start" button to start the stopwatch.

6. Via the "Round" button you record a current round and start a new round.

Use the "Stop" button to start/stop the stopwatch.

Page 31: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

3 Stopwatch

Toolbox Entry ID: 109749914, V1.0, 09/2017 31

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

No. Action

7. The "Reset" button resets the values of the stop times and rounds.

Page 32: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

4 Timer

Toolbox Entry ID: 109749914, V1.0, 09/2017 32

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

4 Timer

4.1 Solution

4.1.1 Description

The timer reminds you of an event after the lapse of a defined runtime.

By default, the timer offers five runtimes (1 min, 2 min, 5 min, 10 min, 15 min). Set the runtime by actuating the appropriate button.

The controller starts a timer with the specified runtime and triggers an alarm once the time has lapsed.

In the status bar you can see when the timer has expired. Click on the status bar to reset the timer.

Figure 4-1

4.1.2 Hardware and software components

The application example is valid for:

SIMATIC S7-1500

WinCC V7.4 SP1

STEP 7 V14 SP1

Page 33: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

4 Timer

Toolbox Entry ID: 109749914, V1.0, 09/2017 33

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

4.1.3 Data types and function blocks used

FC "LGF_DTLtoString"

The "LGF_DTLtoString" function block is taken from the "Library of general functions (LGF) for STEP 7 (TIA Portal) and S7-1200 / 1500". This block converts a character string of the string format with date components into the DTL data type.

Further information on this function block is available at the following link: 109479728.

FB "LHmiTime_Timer"

The "LHmiTime_Timer" function block starts a timer with the "duration" runtime. Once this has lapsed, the function block sets an alarm status "elapsed" and returns the current system time "elapsedTime".

Figure 4-2LHmiTime_Timer

LHmiTime_Timer

Time

duration elapsed

Bool

Bool

reset elapsedTime

String

secRemaining

Int

minRemainin

g

Int

Bool start

Bool

Table 4-1: Parameters of LHmiTime_Timer

Name P type Data type Comment

duration IN Time

reset IN Bool

elapsed OUT Bool

elapsedTime OUT String

secRemaining OUT Int

minRemaining OUT Int

start IN_OUT Bool

Page 34: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

4 Timer

Toolbox Entry ID: 109749914, V1.0, 09/2017 34

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

4.2 Configuration

4.2.1 Controller

Table 4-2

No. Action

1. Download the "109749914_LHmiTime_LIB_V14.zip" library and unzip the file.

2. Open your STEP 7 configuration.

Open the "Global libraries" tab in the "Libraries" task card.

3. Click the second icon from the left to open "Global library".

4. Select the "109749914_LHmiTime_LIB_V14.al14" file and click the "Open" button to open the library.

5. Open the "Master copies" folder of the library. Drag the "LHmiTime_CommDB" data block into the "Program blocks" folder of your controller.

All tags that are required for the timer have the prefix "timer". Delete all other tags from the "LHmiTime_CommDB" data block.

6. Open the "Types" folder of the library and drag the function block "LGF_DTLtoString" and "LHmiTime_Timer" to your controller.

Page 35: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

4 Timer

Toolbox Entry ID: 109749914, V1.0, 09/2017 35

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

No. Action

7. Call the "LHmiTime_Timer" FB in your user program and interconnect the inputs and outputs with the appropriate tags of the communication DB.

8. Compile the project and load it into the controller.

Page 36: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

4 Timer

Toolbox Entry ID: 109749914, V1.0, 09/2017 36

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

4.2.2 HMI

Connection to controller

Table 4-3

No. Action

1. Open the tag management in WinCC.

2. Add a "SIMATIC S7-1200, S7-1500 Channel" as new driver.

3. Create a "New Connection".

Page 37: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

4 Timer

Toolbox Entry ID: 109749914, V1.0, 09/2017 37

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

No. Action

4. Open the connection parameters.

5. Enter the IP address of your controller.

6. Start Runtime.

Page 38: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

4 Timer

Toolbox Entry ID: 109749914, V1.0, 09/2017 38

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

No. Action

7. Click the "Read from AS" button.

8. Load the following tags from the controller.

Name Data type

timerIn Bool

timerPt Int

timerQ Bool

timerRemMin Short

timerRemSec Short

timerReset Bool

timerTimeStamp String

Page 39: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

4 Timer

Toolbox Entry ID: 109749914, V1.0, 09/2017 39

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

Graphics Designer

Table 4-4

No. Action

1. Open the Graphics Designer.

2. Create a "Timer" screen.

3. Add 2 I/O fields. They display the minutes and seconds of the timer. Connect the I/O fields with the tags "LHmiTime_CommDB_timerRemSec" and

"LHmiTime_CommDB_timerRemMin".

4. Add 2 round buttons "START" and "STOP" to the screen.

The round button "START" sets the "LHmiTime_CommDB_timerIn" tag to TRUE.

The round button "STOP" sets the "LHmiTime_CommDB_timerIn" tag to FALSE.

5. Add 5 buttons for the individual minutes of the timer.

Page 40: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

4 Timer

Toolbox Entry ID: 109749914, V1.0, 09/2017 40

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

No. Action

6. The timer tag "LHmiTime_CommDB_timerPt" is given the value of the respective button in milliseconds via VB script.

Minutes Value timerPt

1 min 60000

2 min 120000

5min 300000

10 min 600000

15 min 900000

7. After starting the timer, the operator control of the buttons may only be enabled again when the button "STOP" has been pressed. To do this, open the "Operator-Control Enable" properties via the configuration dialog. The buttons are only to be operable if the "LHmiTime_CommDB_timerIn" tag is set to FALSE.

Page 41: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

4 Timer

Toolbox Entry ID: 109749914, V1.0, 09/2017 41

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

No. Action

8. Add a static text for the status bar, a rectangle and an I/O field.

9. Add the "LHmiTime_CommDB_timerTimeStamp" tag to the I/O field. Note that this is a string tag.

10. The static text, the rectangle and the I/O field may only be visible if the "LHmiTime_CommDB_timerQ" tag is set to TRUE.

Page 42: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

4 Timer

Toolbox Entry ID: 109749914, V1.0, 09/2017 42

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

No. Action

11. The timer is acknowledged by triggering a signal edge. To do this, click the "LHmiTime_CommDB_timerReset" tag to set the value from TRUE to FALSE.

Page 43: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

4 Timer

Toolbox Entry ID: 109749914, V1.0, 09/2017 43

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

4.3 Operation

Table 4-5

No. Action

1. Download the example project and unzip the file.

2. Open the controller project in the TIA Portal. Load the controller project into your controller.

3. Open the visualization project in WinCC V7.4. Start Runtime.

4. Click the "Time functions" button.

Open the "Timer" button.

5. Select a runtime for the timer and start the timer using the "Start" button.

The "Stop" button allows you to stop the timer during runtime.

6. Click the "Timer expired at …" button to acknowledge the timer.

Page 44: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

5 Error Handling

Toolbox Entry ID: 109749914, V1.0, 09/2017 44

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

5 Error Handling

Make sure that the local time on the PC station as well as on the S7-1500 matches.

S7-1500

PC station (WinCC V7.4)

Page 45: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

6 Valuable Information

Toolbox Entry ID: 109749914, V1.0, 09/2017 45

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

6 Valuable Information

The HMI Toolbox for TIA Portal projects can be found in entry ID: 106226404.

Page 46: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

7 Annex

Toolbox Entry ID: 109749914, V1.0, 09/2017 46

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

7 Annex

7.1 Service and support

Industry Online Support

Do you have any questions or need support?

Siemens Industry Online Support offers access to our entire service and support know-how as well as to our services.

Siemens Industry Online Support is the central address for information on our products, solutions and services.

Product information, manuals, downloads, FAQs and application examples – all information is accessible with just a few mouse clicks at https://support.industry.siemens.com/.

Technical Support

Siemens Industry's Technical Support offers quick and competent support regarding all technical queries with numerous tailor-made offers – from basic support to individual support contracts.

Please address your requests to the Technical Support via the web form: www.siemens.en/industry/supportrequest.

Service offer

Our service offer comprises, among other things, the following services:

Product Training

Plant Data Services

Spare Parts Services

Repair Services

On Site and Maintenance Services

Retrofit and Modernization Services

Service Programs and Agreements

Detailed information on our service offer is available in the Service Catalog: https://support.industry.siemens.com/cs/sc

Industry Online Support app

Thanks to the "Siemens Industry Online Support" app, you will get optimum support even when you are on the move. The app is available for Apple iOS, Android and Windows Phone. https://support.industry.siemens.com/cs/ww/en/sc/2067

Page 47: Toolbox for HMI Projects (WinCC V7.4 SP1) · PDF fileWas created with STEP 7 Professional / WinCC Advanced V7.4. ... the "output format" from 999 ... configuring a signal edge for

7 Annex

Toolbox Entry ID: 109749914, V1.0, 09/2017 47

S

iem

en

s A

G C

op

yri

gh

t-Ja

hr

All

righ

ts r

eserv

ed

7.2 Links and literature

Table 7-1

No. Topic

\1\ Siemens Industry Online Support

https://support.industry.siemens.com

\2\ https://support.industry.siemens.com/cs/ww/en/view/109749914

7.3 Change documentation

Table 7-2

Version Date Modification

V1.0 09/2017 First version