You are on page 1of 109

Graphic Screens (1)

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.1 Automation and Drives
Siemens AG 2000. All rights reserved.
Graphic Screens (2)

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.2 Automation and Drives
Siemens AG 2000. All rights reserved.
Graphic Screens (3)

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.3 Automation and Drives
Siemens AG 2000. All rights reserved.
Graphic Screens (4)

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.4 Automation and Drives
Siemens AG 2000. All rights reserved.
Objectives

- Configuration Interface
- Creating Pictures

- Making Dynamic

- Library

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.5 Automation and Drives
Siemens AG 2000. All rights reserved.
Preparation for Configuration (1)

- Process Pictures
- Static Part

- Dynamic Part

- Action Configuration

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.6 Automation and Drives
Siemens AG 2000. All rights reserved.
Preparation for Configuration (2)

- Archiving Messages
- Acquiring Measurement
Values

- Reporting

- Passwords

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.7 Automation and Drives
Siemens AG 2000. All rights reserved.
Operating and Monitoring Terms

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.8 Automation and Drives
Siemens AG 2000. All rights reserved.
Example of Dividing a Screen
Overview area Controls (ActiveX)

B+B Controls (OCX)


such as a linear regulator
such as a clock
Group objects Motor ein

Ventil geschlossen Library objects


Klappe zu such as a motor, valve
Graphic objects
line, circle, etc. Work area
digital value, bar OLE Applications
graphs, etc. 1234.67 such as data from Excel, Word,
or Paint

Keyset area C user routines


Standard Windows Controls such as start via graphic operation
Buttons, Scrollbars, ...

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.9 Automation and Drives
Siemens AG 2000. All rights reserved.
Graphics Editor Configuration Interface

Toolbar Menu bar


Screen name
Frame color
Text color
Object palette
Color palette

Style palette

Alignment palette
Graphic objects from
the object palette

Zoom Lays bar Position Screen size

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.10 Automation and Drives
Siemens AG 2000. All rights reserved.
Graphic Object Palette (1)

Shortcut Menu
Standard Objects

Smart Objects

Windows Objects

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.11 Automation and Drives
Siemens AG 2000. All rights reserved.
Graphic Object Palette (2)

Windows Objects

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.12 Automation and Drives
Siemens AG 2000. All rights reserved.
Graphic Objects (1)

- aligning
- selecting
- changing of attributes
- background grid

Shortcut Menu

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.13 Automation and Drives
Siemens AG 2000. All rights reserved.
Graphic Objectes (2)

-deleting
- changing

- shifting

- duplicating

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.14 Automation and Drives
Siemens AG 2000. All rights reserved.
Graphic Objects (3)

- rotate
- mirror

- arrange

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.15 Automation and Drives
Siemens AG 2000. All rights reserved.
Symbol Library Siemens HMI Symbol Library 1.2 1/2

New symbol library Siemens HMI Symbol Library 1.2

They are not purely graphic objects

rather Controls with dynamic Properties:


Appearance
Flashing mode, speed
Position, colors

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.16 Automation and Drives
Siemens AG 2000. All rights reserved.
Symbol Library Siemens HMI Symbol Library 1.2 2/2

As of V5+SP2

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.17 Automation and Drives
Siemens AG 2000. All rights reserved.
Alignment Palette

Left Right

Top Bottom

Align space horizontally Align space vertically

Divide horizontally Divide vertically

Same width Same height

Same width and height

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.18 Automation and Drives
Siemens AG 2000. All rights reserved.
Style and Tag Palette

Line Style

Line Width

Line Ends

Fill
Pattern

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.19 Automation and Drives
Siemens AG 2000. All rights reserved.
My First Project

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.20 Automation and Drives
Siemens AG 2000. All rights reserved.
Defining a Start Picture
Alternative 1

Activate Runtime

Alternative 2

Shortcut
menu

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.21 Automation and Drives
Siemens AG 2000. All rights reserved.
Autostart Function

Switch on PC

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.22 Automation and Drives
Siemens AG 2000. All rights reserved.
Exit WinCC Explorer

2)
1)

2)
1)

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.23 Automation and Drives
Siemens AG 2000. All rights reserved.
Default Trigger for Objects

Note: User Cycle is suitable for


central changability!

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.24 Automation and Drives
Siemens AG 2000. All rights reserved.
Overview of Possibilities to make Graphic Screens Dynamic with
Accessory Examples 1/2

Configuration Dialog (fast configuration) Type I/O


Dynamic Wizard (configuration assistant) Type I/O
Tag Connection Type O
Dynamic Dialog Type O
Direct Connection Type I
Property actions on the object Type O
corresponding to the ANSI C Syntax
Event actions on the object Type I
corresponding to the ANSI C Syntax

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.25 Automation and Drives
Siemens AG 2000. All rights reserved.
Overview of Possibilities to make Graphic Screens Dynamic with
Accessory Examples 2/2

Direct Connection Type I


Property actions on the object Type O
corresponding to the ANSI C Syntax
Event actions on the object Type I
corresponding to the ANSI C Syntax

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.26 Automation and Drives
Siemens AG 2000. All rights reserved.
Call of Dialogs for Dynamics

Shortcut menu

Shortcut menu

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.27 Automation and Drives
Siemens AG 2000. All rights reserved.
Dynamic Wizard Overview 1/2

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.28 Automation and Drives
Siemens AG 2000. All rights reserved.
Dynamic Wizard Overview 2/2

Valve Line 1 Open

Valve Line 1 Closed

The Wizard generates a C-script in the background that can be used for further applications.

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.29 Automation and Drives
Siemens AG 2000. All rights reserved.
Tag Connecting Overview
Decimal Display

Menu bar > View,


Drop-down >Toolbars
->Tags

Drag & Drop


>=V5

green

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.30 Automation and Drives
Siemens AG 2000. All rights reserved.
Dynamic Dialog Overview
Color Attribute Change

Shortcut menu

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.31 Automation and Drives
Siemens AG 2000. All rights reserved.
Dynamic Dialog Overview
Status Evaluation for Process Tags

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.32 Automation and Drives
Siemens AG 2000. All rights reserved.
Direct Connection Overview

Setpoint rpm

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.33 Automation and Drives
Siemens AG 2000. All rights reserved.
Programming Language C
From the Program Text to the Executable Program

Source Text

Editing (With a compiler that contains a text editor)

Compiling (The C compiler creates an object file with a machine code.)

Linking (The Linker connects several objects into an executable program.)

Executing (The compiled and fully connected program can then be executed.)

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.34 Automation and Drives
Siemens AG 2000. All rights reserved.
Configuration Rules in C Scripts

// WINCC:TAGNAME_SECTION_START
// syntax: #define TagNameInAction "DMTagName"
// next TagID : 1
#define TAG_ I_ Setpoint1 Setpoint1 "
// WINCC:TAGNAME_SECTION_END

// WINCC:PICNAME_SECTION_START
// syntax: #define PicNameInAction "PictureName"
// next PicID : 1
// WINCC:PICNAME_SECTION_END
.
.
SetTagDWord(TAG_ I_ Setpoint1 ,100);

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.35 Automation and Drives
Siemens AG 2000. All rights reserved.
Overview of Property Actions with C Syntax
Calculation of an Output Value

green or
yellow
lightning bolt

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.36 Automation and Drives
Siemens AG 2000. All rights reserved.
Diagnostic Means for C-Scripts
1) {
WORD back;
back=GetTagWord("wert");
printf(Outputfield \r\n");
return back;
1) }

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.37 Automation and Drives
Siemens AG 2000. All rights reserved.
Overview of Event Actions with C Syntax
Increment/ Decrement

Note: Ready-made objects from


the symbol library can be used for
these functions

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.38 Automation and Drives
Siemens AG 2000. All rights reserved.
Tag Input and Output in a C Routine for a Process Value Adjustment

P_tag memory from WinCC (CPU) T_tag memory from C

4.Set
1 1

PA13A 0 1 T_Value1
1.Get 0 1

BOOL T_Value1;
1.Get T_Value1=GetTagBit("PA13A");
T_Value1=! T_Value1;
2.Set
SetTagBit("I_Value2",T_Value1);
I_tag memory from WinCC

2.Set

I_Value2 1 3.Get
3.Get BOOL T_Value1;
T_Value1=GetTagBit("I_Value2");
4.Set SetTagBit("PA13A",T_Value1);

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.39 Automation and Drives
Siemens AG 2000. All rights reserved.
The Way SetTagxxx Works (Asynchronous)

S IE M E N S

S IC O M P

IP C R I 2 0
zzz.pdl

CS
yyy.pdl
RT Event
Trigger
OPEN
SetTagxxx(Soll_Temp2,T_Soll);
<90>

Application
GraphicsRT Write tag
once Data manager with image

Soll_Temp2 90
.
.
. 1x

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.40 Automation and Drives
Siemens AG 2000. All rights reserved.
The Way SetTagxxxWait Works (Synchronous)

S IE M E N S

S IC O M P

IP C R I 2 0
zzz.pdl

CS
yyy.pdl
RT Event
Trigger
OPEN
SetTagxxxWait(Soll_Temp2,T_Soll);
<90>

Application
GraphicsRT Write tag Data manager
once
Soll_Temp2 90
.
.
1x

Acknowledgement

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.41 Automation and Drives
Siemens AG 2000. All rights reserved.
The Way GetTagxxx Works with the Event Name Default Trigger

S IE M E N S

S IC O M P

IP C R I 2 0
zzz.pdl

CS
yyy.pdl
RT Properties
OPEN Default tr. e.g. 2 sec
<81> I1=GetTagxxx(Ist_Temp1); 2sec

return();

Application
GraphicsRT
Announce Data manager with image
all tags
* 1 sec
Ist_Temp1
.
.
.
81

* 1/2 cycle of 2 sec., for example

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.42 Automation and Drives
Siemens AG 2000. All rights reserved.
The Way GetTagxxx Works with the Event Name Tag Trigger

S IE M E N S

S IC O M P

IP C R I 2 0
zzz.pdl

CS
yyy.pdl
RT Properties
OPEN Tag trigger 2 sec
<81> I1=GetTagxxx(Ist_Temp1); ><Ist_Temp1

return();

Application
GraphicsRT
Announce Data manager with image
all tags 2 sec
Ist_Temp1
.
.
.
81

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.43 Automation and Drives
Siemens AG 2000. All rights reserved.
The Way GetTagxxx Works with an Event as Trigger

S IE M E N S

S IC O M P

IP C R I 2 0
zzz.pdl

CS
yyy.pdl
RT Event
Trigger
OPEN
<81> I1=GetTagxxx(Ist_Temp1);

Application
GraphicsRT
Announce Data manager with image
all tags
1 sec
Ist_Temp1
.
.
.
81

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.44 Automation and Drives
Siemens AG 2000. All rights reserved.
The Way GetTagxxxWait Works with an Event as Trigger

S IE M E N S

S IC O M P

IP C R I 2 0
zzz.pdl

CS
yyy.pdl
RT Event
Trigger
OPEN
<81> I1=GetTagxxxWait(Ist_Temp1);

Application
GraphicsRT
Read tag Data manager
once

Ist_Temp1=MW14
1x
Return value 81

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.45 Automation and Drives
Siemens AG 2000. All rights reserved.
Configuration Notes

Making things dynamic with


Performance high -Properties
>tag connection
>faster dynamic dialog with tag trigger and a tag that is assigned parameters
>slower dynamic dialog with tag trigger and several tags that are assigned parameters or
C-actions that are called (Global Script Function)
Performance low >C-actions
-Event
>a mouse click or object change (C-action or direct connection) has no effect on the
picture selection time

Type of Update
-tag trigger (use the same cycle for all tags)
-select a uniform update of a picture
-avoid using Change

Functions
-SetTagMultiWait for several tags is better than many SetTagxxx
-GetTagxxx ( tag is cyclically introduced to the data manager) ,SetTagxxx

Providing PLC Data


-For optimized communication, the data areas of the PLC are to be supplied for specific
pictures.

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.46 Automation and Drives
Siemens AG 2000. All rights reserved.
Setting and Displaying Date and Time

Uhr stellen
Set Clock

The ProgramExecute function is created with


Dynamic Wizard, System Functions tab, Call:
Start another application.

ProgramExecute("C:\\WINNT\\System32\\Control.exe timedate.cpl");

Note: The directory where Control.exe is located depends on the installation of the
WindowsNT Operating System.

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.47 Automation and Drives
Siemens AG 2000. All rights reserved.
Systeminfo-Channel 1/3

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.48 Automation and Drives
Siemens AG 2000. All rights reserved.
Call Systeminfo- Channel 2/3

A)

B)

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.49 Automation and Drives
Siemens AG 2000. All rights reserved.
System Info - Edit Variable 3/3

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.50 Automation and Drives
Siemens AG 2000. All rights reserved.
Configuring Picture Change (Configuration Dialog)
start.pdl schalt.pdl

Configuration with Configuration Dialog

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.51 Automation and Drives
Siemens AG 2000. All rights reserved.
Configuring Function Keys (Configuration Dialog)
start.pdl schalt.pdl
schalt.pdl

F9
F3

Configuration with Configuration Dialog

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.52 Automation and Drives
Siemens AG 2000. All rights reserved.
Digital Input/Output (Configuration Dialog)

Setpoint

kg 20
Type I
Actual value

kg 128
Type O
Dr
Speed

rpm 500
Type I/O

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.53 Automation and Drives
Siemens AG 2000. All rights reserved.
Bar Graph Output (Configuration Dialog)

Configuring additional properties


- Properties/Miscellaneous/Process Driver Connection: temp1
/ Maximum Value: 100
/ Minimum Value: 0
/ Trend: no
- Properties / Color / Bar Background Color: green
/ Trend Color: yellow
- Properties / Font / Font: Arial
/ Font Size: 12
- Properties / Axis / Alignment: right
/ Bar Scaling: linear
/ Digits Left of Decimal Point: 3
/ Digits Right of Decimal Point: 0

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.54 Automation and Drives
Siemens AG 2000. All rights reserved.
Status Display with Files

Runtime

Drag&Drop

Closed Open

Menu -> File,


Drop-down ->Export

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.55 Automation and Drives
Siemens AG 2000. All rights reserved.
Overview of Configuration Possibilities for Color Changes with
Accessory Examples

Wizard, Color Dynamics with Table


Dynamic Dialog
C-Action
Tag Connection to the corresponding
color property

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.56 Automation and Drives
Siemens AG 2000. All rights reserved.
Wizard Overview, Color Dynamics with Table

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.57 Automation and Drives
Siemens AG 2000. All rights reserved.
Overview of Color Change with the Dynamic Dialog

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.58 Automation and Drives
Siemens AG 2000. All rights reserved.
Overview of Color Change with a C Action

+0 Type I/O

In order to give emphasis to the new


function, we dispensed with the
comment and define lines.

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.59 Automation and Drives
Siemens AG 2000. All rights reserved.
Philosophy for On/Off Operations
Task Solution

C-action
Toggle function with mouse-click
with acknowledgement Direct Connection
Dynamic Wizard
C-action

Toggle function with mouse-click C-action


without acknowledgement

Set Bit in var1 C-action


Reset Bit in var2
Set Bit in var2 C-action
Reset Bit in var1

Set Toggle with mouse-click On Direct Connection


Reset Toggle with mouse-click Off Dynamic Wizard
C-action

Left / right mouse button for toggle Direct Connection


Dynamic Wizard
C-action

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.60 Automation and Drives
Siemens AG 2000. All rights reserved.
1. Binary Switching Operation (Two-Step Operation)
with Acknowledgement

Configuring with C-action:


Events/Mouse/Press Left/Action
BOOL T_value1; pbo.pdl
T_value1=GetTagBit("PA13A"); Operating picture Dialog box2
T_value1=!T_value1; Diapa13A.pdl
SetTagBit("I_value2",T_value1);

Configuration with Direct Connection:


Source: Tag I_Value2
Target: Tag PA13A

Configuration with Direct Connection:


Source: Constant 0
Target: Current Window -> Display

Configuration with Dynamic Wizard:


Picture function
Display WCCDialog Box with Diapa13A.PDL

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.61 Automation and Drives
Siemens AG 2000. All rights reserved.
2. Binary S/R Switching Operation (Two-Step Operation)

Configuring with C action: pbo.pdl


Events/Mouse/Press Left/Action Operating picture
SetTagBit("PA13_1",TRUE);
SetTagBit("PA13_0",FALSE); Diapa13.pdl
Dialog box1

Configuring with C action:


Events/Mouse/Press Left/Action
SetTagBit("PA13_1",FALSE);
SetTagBit("PA13_0",TRUE);

Configuration with Direct Connection:


Source: Constant 0
Target: Current Window -> Display

Configuration with Dynamic Wizard:


Picture function
Display WCCDialog Box with Diapa13.pdl

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.62 Automation and Drives
Siemens AG 2000. All rights reserved.
3. Binary Switching Operation without Acknowledgement
(Two-Step Operation)
Picture Change in Window
Configuration with Dynamic Wizard:
Configuring with C action: -Picture function
Events/Mouse/Press Left/Action Operating picture -Picture change in window with Diapa14A.pdl
BOOL T_Value1; Diapa13B.pdl
T_Value1=GetTagBit("PA13B"); pbo.pdl
T_Value1= !T_Value1; PA 13B
PA 13B
Picture window1
SetTagBit("PA13A",T_Value1);

Diapa 13B,pdl
PA 13B

Diapa14A.pdl
PA 14A

Configuration with Dynamic Wizard:


-Picture function
-Picture change in window with Diapa13B.pdl
Picture window1 Attributes

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.63 Automation and Drives
Siemens AG 2000. All rights reserved.
Bit Setting in a Word with the Dynamic Wizard

conveyer 4 conveyer 3 conveyer 2 conveyer 1

Switching operation,
Configuration with Dynamic Wizard:
-Standard Dynamics
-Setting/Resetting a bit

Color change,
Configuration with Dynamic Dialog:
-Data type Bit

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.64 Automation and Drives
Siemens AG 2000. All rights reserved.
Bit Setting in a Word with C-action (Toggle)
...0000 0000 conveyor Configuring with C-action for mouse operation :

int value,zvalue;
0000 0000 value value=GetTagWord("conveyor");
& 0000 0001 zvalue=value&0x0001;
if 0000 0000 zvalue==0 if (zvalue==0){
value=value|0x0001;
0000 0000 value }
I 0000 0001 else{
value=value&0xfffe;
0000 0001 value, conveyor }
SetTagWord("conveyor", (short int)value;
conveyor 1 on

Configuring with C action for mouse operation:

int value,zvalue;
value=GetTagWord("conveyor");
zvalue=value&0x0002;
if (zvalue==0){
value=value|0x0002;
}
else{
value=value&0xfffd;
} 0x0004 0x0008
SetTagWord("conveyor",(short int)value);
0xfffb 0xfff7

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.65 Automation and Drives
Siemens AG 2000. All rights reserved.
Setpoint On/Off Button with Enabling
Message text

Enable missing!

Value = 0 (gray)
green or
Value = 100 (green) yellow
Value = 150 (yellow)

Value = 180 (red)

Value = 190 (red, flashing)

Enable

Configuration
-Events/ Button/ Mouse/
Mouse-click/ C-Action:

BOOL ok;
ok = GetTagBit("Enable");
ok = !ok;
SetTagBit("Enable",(WORD)ok);

Exercise:

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.66 Automation and Drives
Siemens AG 2000. All rights reserved.
Incrementing/Decrementing in a Specified Value Range

Making dynamic with Configuration Dialog


I/O Field2 1234
Message text

Value range from 0 to 100! Configuring with C-action :


L+/R- -Events/ Mouse/Press Right/ Action:
Button L+/R- WORD Temp;
Temp = GetTagWord("value");
Temp = Temp - 1;
Configuring with C-action :
-Events/ Mouse/Press Left/ Action: :
WORD Temp; Alternative: Symbols from library
Temp = GetTagWord("value");
Temp = Temp + 1;
if (Temp>100)
{Temp=100;
SetTagWord("value",Temp);
SetVisible(lpszPictureName, "helptext",1); }
else {
SetTagWord("value",Temp);
SetVisible(lpszPictureName, "helptext",0);
}

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.67 Automation and Drives
Siemens AG 2000. All rights reserved.
Slider Object for Adjustments

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.68 Automation and Drives
Siemens AG 2000. All rights reserved.
Check Box (Events at the Object)
Configuring with tag connection:
-Properties/ Output-input/ Selected Fields/ Dynamics:
Tangram (signed 32-bit value)

Deleting the display with:


Direct Connection:
-Source: Constant 0
-Target: Tag Tangram

Making the Display Dynamic with:


Dynamic Dialog.
Bit address
0 //Head
1 //Left Arm
2 //Right Arm
3 //Left Leg
4 //Right Leg
5 //Left Foot
6 //Right Foot

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.69 Automation and Drives
Siemens AG 2000. All rights reserved.
Option Group (Events at the Object)
"Color value_container"
"Color_input" Configuring:
-Events/ Option Group/ Miscellaneous/ Object Change/ C-action:
int input;
input=GetTagDWord("Color_input");
switch (input) {
case 1: SetTagDWord("Colorvalue_container",CO_RED); break;
case 2: SetTagDWord("Colorvalue_container",CO_GREEN); break;
case 4: SetTagDWord("Colorvalue_container",CO_BLUE); break;
}
- Properties/ Option Group/ Output-input/ Selected Field/ Dynamic /
Tag:
Color_input
Configuring:
-Events/ Option Group/ Property topics/ Output/ Input/ Selected
Field/ Change/ C-action:
int input;
input=GetTAGDWord("level_input");
switch (input) {
case 1: SetTagDWord("level_container",20); break;
case 2: SetTagDWord("level_container",50); break;
Configuring: case 4: SetTagDWord("level_container",90); break;
-Properties/ I/O field/ Output-input/ }
Output Value/ Dynamic: -Properties/ Option Group/ Output-input/ Selected Field/ Dynamic/
"level_container" Tag:
level_input

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.70 Automation and Drives
Siemens AG 2000. All rights reserved.
1. Operator Help per Operation
2. ToolTip Text
help.pdl Configuring
-Properties/Static Text/ Object Name: helpText1
/ Layer: 2
/ Font/ Text: boiler temperature
0 to 100
/ Font/ X Alignment: centered
/ Font/ Y Alignment: centered
/ Miscellaneous/Display: no

Configuration with Direct Connection:


- Source: Constant 1
- Target: Object in Picture, helpText1, Display
Configuring with Direct Connection:
- Source: Constant 0
- Target: Object in Picture, helpText1, Display

Configuring ToolTip text:


- Properties / Miscs/ ToolTip text: Boiler 10

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.71 Automation and Drives
Siemens AG 2000. All rights reserved.
3. Operator Help as Pop-up Operation

Configuring:
-Properties/Static Text/ Object Name: Info text
/ Layer: 2
/ Font/ Text: display overview picture
/ Font/ X Alignment: centered
/ Font/ Y Alignment: centered
/ Miscellaneous / Display: No

Configuring with Direct Connection:


Press the right mouse button:
- Source: Constant 1
- Target: Object in Picture, Infotext, Display

Configuring with Direct Connection:


Release the right mouse button:
- Source: Constant 0
- Target: Object in Picture, Infotext, Display

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.72 Automation and Drives
Siemens AG 2000. All rights reserved.
4. Closing a Window after a Configured Time
Configuring: Configuring:
-Properties/ Picture Window/ Miscellaneous / Display / - Properties /Miscellaneous /Display:No
Dynamic: - Properties/Picturename: Eingabe_Hinweis.pdl
BOOL visible;
static int count=5; PictureWindow1
visible=GetVisible(lpszPictureName,lpszObjectName); help.pdl
if (visible){count--;
if (count<=0){
count = 5;
return 0;}
else return 1;
}
Eingabe_Hinweis.pdl
return 0;

Configuring with Direct Connection: Configuring with Direct Connection:


- Source: Constant 0 Press right mouse button.
- Target: Current Window -->Display - Source: Constant 1
- Target: Object in Picture, PictureWindow1, Display

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.73 Automation and Drives
Siemens AG 2000. All rights reserved.
5. WinCC Functions for Zooming Picture Windows
Configuring:
Properties/ Picture Window/
Miscellaneous/ Adapt Picture: yes

Configuring with C-action: PictureWindow 1


Events/ Button / Mouse/ Press Left
SetHeight(lpszPictureName,"PictureWindow1",150);
SetWidth(lpszPictureName,"PictureWindow1",200);
Configuring with C-action:
Events/ Button / Mouse/ Press Left
SetHeight ( lpszPictureName,"PictureWindow1",115);
SetWidth(lpszPictureName,"PictureWindow1",185);

Configuring with C-action: Configuring with C-action:


Events/ Button / Mouse/ Press Left Events/ Button / Mouse/ Press Right
int h, b; int h, b;
h = GetHeight ( lpszPictureName,"PictureWindow1"); h = GetHeight ( lpszPictureName,"Picturewindow1");
b = GetWidth(lpszPictureName,"PictureWindow1"); b = GetWidth(lpszPictureName,"Picturewindow1");
SetHeight ( lpszPictureName,"PictureWindow1",h*1.2); SetHeight ( lpszPictureName,"PictureWindow1",h/1.2);
SetWidth(lpszPictureName,"PictureWindow1",b*1.2); SetWidth(lpszPictureName,"PictureWindow1",b/1.2);

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.74 Automation and Drives
Siemens AG 2000. All rights reserved.
6. Input Check with Help (Automatic/Manual)
Eingabe_Hinweis.pdl Configuring with Direct Connection:
- Source: Constant 0
- Target: Current Window -->Display
PictureWindow 1
help1.pdl
Configuring with C-action:
-Events/ I/O field/ Property topics/ Output-input/ Input value/ C action:
int input, output;
input = GetInputValueDouble(lpszPictureName,lpszObjectName);
output = GetTagDWord("value");
if ((input > 100) || (input < 0)){
SetVisible(lpszPictureName,"PictureWindow1",1);
}
else {
output = input;
SetTagDWord("value",output);
}
SetOutputValueDouble(lpszPictureName,lpszObjectName,output);

Configuring with Direct Connection: Configuring with C-action:


Press right mouse button. -Properties/ I/O field/ Output-input/
- Source: Constant 1 Output value/ Dynamic/ C action:
- Target: Object in Picture, PictureWindow1, Display return GetTagDWord("value");

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.75 Automation and Drives
Siemens AG 2000. All rights reserved.
Customized Object

Pos.
X

Drag & Drop


create
1. Shortcut menu

2.

3. Shortcut menu

Result

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.76 Automation and Drives
Siemens AG 2000. All rights reserved.
Indirect Addressing
I_Wert_1

Enable

The tag namevariable must be created as an internal tag of the Text tag 8-bit character set data type.

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.77 Automation and Drives
Siemens AG 2000. All rights reserved.
Block Technology Overview

-Tag Prefix
(>=V5.0)

-Indirect Addressing
(regardless of the version)

-Picture in Picture Technology with Dynamic


Wizard
(Picture blocks: 1. TypeWizard, 2. InstanceWizard, >=V4.02)

-ActiveX Controls (SIMATIC HMI Option with


IndustrialX)
(additional with VB 5 configuration tool)

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.78 Automation and Drives
Siemens AG 2000. All rights reserved.
Block Technology in General

Template with
type objects
Tags (instances)
generated from
structure tag Application
picture

Data records
in the
SIMATIC PLC
Structure
Type
Editor
M M M

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.79 Automation and Drives
Siemens AG 2000. All rights reserved.
Task: Project in Runtime, One Picture Window for Each Button Call
Tag Prefix

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.80 Automation and Drives
Siemens AG 2000. All rights reserved.
Create Structure Tag in the Project

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.81 Automation and Drives
Siemens AG 2000. All rights reserved.
Create Internal Tags and/or Process Tags fitting to the Structure

Motor_4

Tags for
Instance Formation

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.82 Automation and Drives
Siemens AG 2000. All rights reserved.
Configure Template, Output Value 1/4

x:280

y:190 member name

limits:0 -100 from library

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.83 Automation and Drives
Siemens AG 2000. All rights reserved.
Configure Template, Background Color for Limit Values 2/4

Additionally
create as internal
tag

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.84 Automation and Drives
Siemens AG 2000. All rights reserved.
Configure Template, Field Type 3/4

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.85 Automation and Drives
Siemens AG 2000. All rights reserved.
Configure Template, Background Color for Switch Condition 4/4

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.86 Automation and Drives
Siemens AG 2000. All rights reserved.
Configure Motor Picture, Attributes for Picture Window, 1/4

2
3

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.87 Automation and Drives
Siemens AG 2000. All rights reserved.
Configure Motor Picture, Title for Picture Window, 2/4

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.88 Automation and Drives
Siemens AG 2000. All rights reserved.
Configure Motor Picture, Call Picture Window, 3/4

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.89 Automation and Drives
Siemens AG 2000. All rights reserved.
Result: Project in Runtime 4/4

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.90 Automation and Drives
Siemens AG 2000. All rights reserved.
Task: Project in Runtime, One Picture Window for Several Motors

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.91 Automation and Drives
Siemens AG 2000. All rights reserved.
Sequence in Instance Formation

SetTagPrefix(); SetTagPrefix();
SetPictureName(); SetPictureName();

Note: SetTagPrefix(); The Tag Prefix attribute can be made dynamic with the name TagPrefix.
SetPictureName(); The Picture Name attribute can be made dynamic with the name PictureName.

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.92 Automation and Drives
Siemens AG 2000. All rights reserved.
Configure Motor Picture, Attributes for Picture Window

2
3

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.93 Automation and Drives
Siemens AG 2000. All rights reserved.
Configure Motor Picture, Title for Picture Window

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.94 Automation and Drives
Siemens AG 2000. All rights reserved.
Configure Motor Picture, Button for Connecting the Tag Prefix

SetTagPrefix(lpszPictureName,"Bildfenster6",Motor_1.");
SetPictureName(lpszPictureName,"Bildfenster6",Motor_Box.pdl");

SetTagPrefix(lpszPictureName,"Bildfenster6",Motor_2.");
SetPictureName(lpszPictureName,"Bildfenster6",Motor_Box.pdl");

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.95 Automation and Drives
Siemens AG 2000. All rights reserved.
Indirect Addressing Overview
3) sbb_ind_Adr_grafik.PDL sbb_ind_Adr.PDL
2)
Internal tags I_Setpoint
Unter-
Value
objekt_1 Picturewindow1
I_Setpoint Value
I_Actual Value I_Actual Unter- Unter-
Value I_Setpoint objekt_1
... objekt_2 Value
I_Manual
Value I_Actual
Unter- Value Unter-
Process tags objekt_n objekt_2

(Structure tag) I_Manual


Value
Unter-
objekt_n
Drive1.Setpoint v. Ind. Addressing
4)
Drive1.Actual val.
...
Drive2.Setpoint Connect when
Drive2.Actual picture is selected
...
Drive 1 Drive 2
1) Create structure type e.g.
Drive. 5) 5)

SetPictureName(lpszPictureName,PictureWindow1","sbb_ind_Adr_grafik.PDL");
SetVisible(lpszPictureName,PictureWindow1",1);
SetTagMultiWait("%s%s%s",
"I_Setpoint",Drive1.Setpoint",
"I_Actual",Drive1.Actual",
"I_Manual",Drive1.Manual");

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.96 Automation and Drives
Siemens AG 2000. All rights reserved.
Picture in Picture Technology with Dynamic Wizard Overview 1/2
1) Create structure type 2) Template (LC.PDL) with @TYPE_LC.pdl
e.g. Antrieb (drive).
Setpoint Object_1
Value
Create process tags Actual
Drive1.Setpoint Value

Drive1.Actual 3) Template Wizard Object_2


Manual
... Value

Drive2.Setpoint Object_n

Drive2.Actual
...
Antrieb 1
4) CallAntrieb
graphic1 picture
Drive 1 Drive 2
xyz.PDL
5) Instance Wizard 5)

Fixed module in picture

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.97 Automation and Drives
Siemens AG 2000. All rights reserved.
Picture in Picture Technology with Dynamic Wizard Overview 2/2

Performance Profile

Instance Type 1: fixed (picture) module in picture

Instance Type 2: one module that can be displayed and that can be called
using one button (per tag)

Instance Type 3: several modules that can be displayed and that each can be
called using one button (tag)

Instance Type 4: fixed module with selectable name

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.98 Automation and Drives
Siemens AG 2000. All rights reserved.
Block Technology with ActiveX- Controls
(Option with IndustrialX)
IndustrialX

Basic and WinCC Controls Service Controls

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.99 Automation and Drives
Siemens AG 2000. All rights reserved.
Display Picture Name in any Picture

-With the key combination Shift+Ctrl+Alt


(In Runtime, point with the mouse on an object in the picture. After a short time a
ToolTip text is displayed).

-Display status line at the bottom


(In the WinCC Explorer, using Computer properties, select the window attribute
"Status-Line ". After Deactivate - Activate Runtime the picture name of every
picture is displayed in the Status-Line at the bottom).

-Updating a static text per C-Script


(Solution is dislayed in the text below).

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.100 Automation and Drives
Siemens AG 2000. All rights reserved.
User Administrator (Password Protection) 1/3

Shortcut menu:
Open

Group Electrician Locksmith


User Login Otto Willi
Password Otto_WB Willi_B

No Function Enable No Function Enable

1 Value input 1 Value input -



2 Picture change 2 Picture change

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.101 Automation and Drives
Siemens AG 2000. All rights reserved.
User Administrator (Password Protection) 2/3

Group

Mouse
double-click

Create a
window for
a group or
user

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.102 Automation and Drives
Siemens AG 2000. All rights reserved.
User Administrator (Password Protection) 3/3

Setpoint

Shortcut menu:
Properties

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.103 Automation and Drives
Siemens AG 2000. All rights reserved.
Exercise 1: Creating a Picture (Static Component)

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.104 Automation and Drives
Siemens AG 2000. All rights reserved.
Exercise 2: I/O Fields for Setpoints and Actual Values
I/O field for the
setpoint speed
Output field for the
actual speed

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.105 Automation and Drives
Siemens AG 2000. All rights reserved.
Exercise 3: Bar Graphs for Setpoints and Actual Values

Bar graph for


setpoint speed
Bar graph for
actual speed

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.106 Automation and Drives
Siemens AG 2000. All rights reserved.
Exercise 4: Motor Color Change

Motor symbol with


color animation

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.107 Automation and Drives
Siemens AG 2000. All rights reserved.
Exercise 5: Status Display with Operation

Switch symbol with:


1. Operating capability
2. Display change

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.108 Automation and Drives
Siemens AG 2000. All rights reserved.
Exercise 6: Help Function

Press the right mouse


button to display the
Picture Window
Release the right
mouse button to hide
the Picture Window

SIMATIC HMI Date: 06.10.2017


SITRAIN Training for
File: SWINCC_04e.109 Automation and Drives
Siemens AG 2000. All rights reserved.

You might also like