0% found this document useful (0 votes)
133 views46 pages

04 PictureBlocks PDF

Uploaded by

carsan87
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
133 views46 pages

04 PictureBlocks PDF

Uploaded by

carsan87
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Block Technology (1)

SITRAIN
ST-BWINCCS /PictureBlocks Page 1 Siemens AG © 2007

Contents Page
Block Technology (2) ........…….......................................................................................................... 2
Objectives ...................…..................................................................................................................... 3
Preparation for Configuration ............................................................................................................ 4
Block Technology Overview ................................................................................................................ 5
Indirect Addressing ...………............................................................................................................... 6
Customized Object with Process-Relevant Attributes ......................................................................... 7
Exercise 1: Customized Object with Process-Relevant Attributes ...................................................... 8
Block Technology in General .............................................................................................................. 9
Task: Show Three Faceplates when Displaying a Screen …............................................................ 10
Creating a Structure Type in the Project ............................................................................................. 11
Creating Internal Tags and/ or Process Tags fitting to the Structure ….............................................. 12
Configure Template, Output Value 1/4 .........…................................................................................... 13
Configure Template, Background color for Limit Values 2/4 ..……….................................................. 14
Configure Template, Field Type 3/4 .................................................................................................... 15
Configure Template, Background Color for Speed Setpoint Value 4/4 ............................................... 16
Configure Motor_Picture, Attributes for Picture Window ..................................................................... 17
Exercise 2: Show Three Faceplates when Displaying a Screen ........................................................ 18
Task: Display Picture Window using Button ……................................................................................ 19
Configure Motor_Picture, Call Picture Window, 1/2 ........................................................................... 20
Configure Motor_Picture, Title for Picture Window, 2/2 ….................................................................. 21
Exercise 3: Display Picture Window using Button .............................................................................. 22
Task: A Picture Window with Selectable Tag Prefix .…….................................................................. 23
Sequence in Instance Formation ........................................................................................................ 24

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 1 PictureBlocks
Block Technology (2)

SITRAIN
ST-BWINCCS /PictureBlocks Page 2 Siemens AG © 2007

Contents Page
Configure Motor_Picture, Attributes for Picture Window .................................................................... 25
Configure Motor_Picture, Title for Picture Window ..…....................................................................... 26
Configure Motor_Picture, Button for Connecting Tag Prefix ..……….................................................. 27
DB101 – DB103, Setting the Operator Control and Monitoring Attribute (1/2) ................................... 28
DB101 – DB103, Setting the Operator Control and Monitoring Attribute (2/2) ................................... 29
Compiling the OS: Start (1/2) …........................................................................................................ 30
Compiling the OS: Result (2/2) ....….................................................................................................... 31
Exercise 4: Picture Window with Selectable Tag Prefix (1/2) .......................................................... 32
Exercise 4: Picture Window with Selectable Tag Prefix (2/2) .......................................................... 33
Faceplate with Process-Relevant Attributes and Central Changeability ............................................ 34
Faceplate with Process-Relevant Attributes and Central Changeability ............................................ 35
Creating and Configuring a Faceplate Type with Individual Objects 1/3 ............................................ 36
Creating a Faceplate Instance 2/3 .....…............................................................................................. 37
Dynamizing and Duplicating a Faceplate Instance 3/3 …................................................................... 38
Exercise 5: Display of Three Faceplate Instances in a Screen ......................................................... 39
Exercise 5: Creating a Faceplate Instance / Scaling Mode ............................................................... 40
Exercise 5: Dynamizing a Faceplate Instance / Properties ................................................................ 41
Exercise 5: Dynamizing a Faceplate Instance / Event ....................................................................... 42
Exercise 5: Display of Three Faceplate Instances in a Screen ........................................................... 43
Exercise 6: Expanding the Faceplate Type ...................................................................................... 44
Exercise 6: Expanding the Faceplate Type ….................................................................................... 45
Block Technology with ActiveX Controls (Option with IndustrialX) ..................................................... 46

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 2 PictureBlocks
Objectives

- Block technology through:

- Indirect addressing

- Customized objects

- Faceplates with tag prefix

- Faceplate types

- ActiveX objects (via option)

SITRAIN
ST-BWINCCS /PictureBlocks Page 3 Siemens AG © 2007

Upon completion of this chapter, the participant should be able to:


• Know different solutions for the use of WinCC blocks in WinCC
graphic displays
• Use indirect addressing
• Create and change user objects
• Configure blocks that can be changed centrally using a tag prefix
• Know faceplate types that can be changed centrally
• Obtain information about the IndustrialX option

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 3 PictureBlocks
Preparation for Configuration

- Blocks

- Static Part

- Dynamic Part

- Action Configuration

SITRAIN
ST-BWINCCS /PictureBlocks Page 4 Siemens AG © 2007

Configuration Preparation

• Use of the block technology


- Definition of block type (indirect addressing, customized object, picture in
picture, faceplate type, ActiveX Control)
- Definition of the block functionality
- Definition of the display of blocks (selectable or always visible)
- Specifying the static display per picture (text, line, circle, rectangle, color,
etc.)
- Specifying the active (dynamic) parts per picture (input/output value, bar
graph output, switching operation, trends, messages, etc.)
- Specifying tags/structure tags for the dynamics
- Specifying the file name
- Specifying operator devices (mouse, function keys, etc.)

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 4 PictureBlocks
Block Technology Overview

- Indirect addressing
- Customized objects
- Faceplates with tag prefix (picture in picture)
- Faceplate types

- ActiveX Controls (SIMATIC HMI option with IndustrialX)


(additionally with Visual Basic configuration tool)

SITRAIN
ST-BWINCCS /PictureBlocks Page 5 Siemens AG © 2007

Block Technology Picture block technology allows the engineer to create functions (such as motor
blocks, drive blocks, open-loop controller blocks etc.) that are used many times,
whereby every call of the function works with its own data.
The overview shows you two configuration possibilities. The tag prefix method is
created with the WinCC tools.
ActiveX Controls can be made with the option package Industrial X and Visual
Basic Version 6.

Tag Prefix Simple creation of picture modules. The template can be changed from a central
location. All possibilities for making dynamic can be used:
+ Configuration Dialog
+ Dynamic Wizard
+ Tag Connection
+ Dynamic Dialog
+ Direct Connection
+ Property Actions according to ANSI C Syntax or VBScript
+ Event Actions according to ANSI C Syntax or VBScript

ActiveX Controls To use this you need to have knowledge of an additional editor, such as, Visual
Basic.
User-application blocks with high performance (templates, faceplates) and with
know-how protection.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 5 PictureBlocks
Indirect Addressing

I_Value_1

Enable

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

SITRAIN
ST-BWINCCS /PictureBlocks Page 6 Siemens AG © 2007

Objective With the indirect addressing of attributes, the number of objects and the dynamics
(performance profile) associated with it can be reduced.
At the same time, the picture content is easier to read.

Task The level of several containers is to be represented by an output field.

Procedure 1. Create the internal tag " TagName " of the "Text tag 8-bit character set" data
type.

2. Create the operating and output objects as shown in the graphic slide above.

3. The assignment of the internal tag “TagName" takes place through the direct
connection by mouse click. The source parameter is passed to the target
variable.

4. So that the value of the tag "I_Value_1" is output at the IOField using the
attribute "Output Value", the "TagName" must be enabled through the
checkbox in the Indirect column.

Note If the container name is also to be output using an object "Static Text", you have to
use the following script by mouse click.
char szText[20]=“Container 1”;
SetTagChar("TagName","I_Value_1");
SetPropChar(lpszPictureName,"StaticText1","Text",szText);

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 6 PictureBlocks
Customized Object with Process-Relevant Attributes

Pos. X

Drag & Drop

1. Context menu create

2.

Result
3. Context menu
SITRAIN
ST-BWINCCS /PictureBlocks Page 7 Siemens AG © 2007

Customized Object The customized object allows you to make a hidden configuration of object
properties. This makes it possible to display only those properties that are
important for the process visualization. Also, the names of the properties can be
changed by the designer of the Customized Object, even in multiple languages.
The Customized Object can be copied into the library by means of Drag and Drop.
Then in the reverse way, the Customized Object can be copied into any WinCC
picture.

Note The Global Library contains a whole series of such Customized Objects (e.g.
measuring instruments). These objects can be extended any time with your own
objects.

Task The position of a rectangle is to be dynamically changed with the help of a


Customized Object.
Only this one property is to be shown to the final user.

Procedure The rounded rectangle (or all objects, belonging to this Customized Object) are
positioned in the graphic picture. Next all objects are selected and the

1. Shortcut menu is created with the Customized Object setting.

2. Activate "Customized Object" --> "Create...".


A Configuration Dialog Customized object will appear where "Selected
Properties" (see screen in slide) can be deleted, added and renamed.

3. The process tags can be connected via the properties of the Customized
Object.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 7 PictureBlocks
Exercise 1: Customized Object with Process-Relevant Attributes

Tooltip text

SITRAIN
ST-BWINCCS /PictureBlocks Page 8 Siemens AG © 2007

Objective A help text is to be displayed on the two toggle buttons. The help text is to be
configured as a tooltip text. Through the Object Properties, you can see that the
toggle button exists as a customized object. This customized object is now to be
expanded with the attribute Tooltip text using the customized object configuration
dialog.

Exercise 1. Through double click while shift key is pressed, activate the editing of the
"Configuration Dialog Customized object" and expand the list of properties by
adding the property "Tooltip Text" and adopt (copy) the texts shown in the
slide above.

2. Save the picture and test the function.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 8 PictureBlocks
Block Technology in General

Template .pdl with


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

Smart Object:
Connect faceplate
to type graphic

Data records
in the
Structure Type SIMATIC PLC
Editor

M M M

SITRAIN
ST-BWINCCS /PictureBlocks Page 9 Siemens AG © 2007

General To reduce the costs of configuration and management of simular process objects,
WinCC offers you the opportunity of using picture block technology.

Based on similarly structured data records in the PLC (interface description for
function blocks), the Structure Tag (template) is created (for example motor
blocks, drive blocks, open-loop controller blocks etc.) with the Structure Type
Editor in the WinCC Explorer and the tags (instances).
This structure tag represents the interface used to read and write data to the PLC
for one specific object type.
Then, the type objects are created in the template and these are connected to the
Struct-Membername in the structure tag. For example, when a type object is
called, this object is connected to the relevant addresses from the PLC (tag prefix=
instance name).

Tag name: [instance name] .[member name]

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 9 PictureBlocks
Task: Show Three Faceplates when Displaying a Screen

Runtime view of the screen Motor_picture.pdl

SITRAIN
ST-BWINCCS /PictureBlocks Page 10 Siemens AG © 2007

Task The faceplate for a motor shows the typical elements for operating and
displaying. You can perform a switching operation with the left switch. With the
right switch, you can set the manual mode for adjusting the setpoint. In addition,
the logged-on user is to be shown (prerequisite: the User Administrator is
configured and a user is logged on).

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 10 PictureBlocks
Creating a Structure Type in the Project

SITRAIN
ST-BWINCCS /PictureBlocks Page 11 Siemens AG © 2007

Create Structure Type


As member names (names of the individual structure elements), the same names
as in data block DB1 "User" are used: "Speed_SP”, “Speed_ACT”, “Temperature”,
“On_Off” and “Direction_SP". This permits that during the exercise the faceplate to
be created can be operated with this structure, with the transferred data block DB1
"User", and with the data blocks DB 101 to DB 103 (which still need to be
transferred; compile via OS).

FAQ 16504646 Question: How can I edit a WinCC structure type without having to delete existing
structure tags for this type?

Characters Not Allowed


Names of structure types, structure elements, structure instances:
? ' \ @ * % Blank

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 11 PictureBlocks
Creating Internal Tags and/or Process Tags Fitting to the Structure

Motor_3

Structure
type Motor

Tags for
instance:
Motor_3

SITRAIN
ST-BWINCCS /PictureBlocks Page 12 Siemens AG © 2007

Tags for Instances


In the slide you can see the structure tags for two of three motors. The structure
tags are located in the "motor_prefix" group. "Motor_1." to "Motor_3." were
selected as instance names. As member names (names of the individual structure
elements), the same names as in the "User" data block were used: “Speed_SP”,
“Speed_ACT”, “Temperature”, “On_Off” and “Direction_SP”.

Character Length Length of tag names: [Instancename] .[ Membername]


is a maximum of 128 characters.
- a maximum of 31 instances of the same template can be used in one system
picture.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 12 PictureBlocks
Configure Template, Output Value 1/4

Member-Name:
“Speed_ACT”

from library
IOField with tag connection @NOTP::@CurrentUser
SITRAIN
ST-BWINCCS /PictureBlocks Page 13 Siemens AG © 2007

Task With the template shown in the slide, you are to be able to change the setpoint
speed of a motor. At the same time, the input value is to be monitored by a
dynamic dialog at the I/O field for the setpoint input. The setpoint speed and actual
speed are also to be displayed as bars. The motor is to be switched on and off via
the left change-over switch. The right change-over switch is to be used for
selecting the direction of rotation of the motor. In addition, the logged on user is to
be displayed (this requires configuration by the User Administrator and a logged
on user).

The system tag @CurrentUser is generated when a project is created. The system
tag reads the name of the logged on user from the database. However, this tag
cannot be displayed in the faceplate just like that, since it is not an element in the
structure used in this exercise. In this case, a tag add-on must be used to be able
to request tags without tag prefix in a faceplate.
If the tag add-on @NOTP::tag_name (NO Tag Prefix) is entered before a tag, the
tag prefix is ignored in the picture window. This permits that also tags can be
displayed which are not instantiated, i.e. tags that are not located in a structure
such as "Motor".

Further tag add-ons:


- @NOSP:: tag name (NO Server Prefix) deactivates the server prefix
- @NOP:: tag name (NO Prefix deactivates the tag prefix and the server prefix).

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 13 PictureBlocks
Configure Template, Background Color for Limit Values 2/4

Member name:
“Speed_ACT”

SITRAIN
ST-BWINCCS /PictureBlocks Page 14 Siemens AG © 2007

Dynamic Dialog Internal tags are needed so that the Dynamic Dialog can be closed without an
error message appearing (a reference to open tag references appears). For this
purpose, create the tags “Setpoint” and “Actual value” as internal tags (dummies)
in the tag group “Motor_Prefix”. At runtime, WinCC will then only access the
structure tags. Addressing is implemented via the tag prefix of the picture window
(instance name) and the tag names used at the object in the faceplate (member
name) --> [instance name] .[member name].

Note If you work without “dummy” tag, you must perform the following steps since the
Dynamic Dialog checks the existence of the tag in the Tag Management:

1st step: In the Dynamic Dialog, press the "Apply" button.


2nd step: Then select "Ignore“ in order to complete the configuration.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 14 PictureBlocks
Configure Template, Field Type 3/4

Member name:
“Speed_SP”

SITRAIN
ST-BWINCCS /PictureBlocks Page 15 Siemens AG © 2007

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 15 PictureBlocks
Configure Template, Background Color for Speed Setpoint Value
4/4

SITRAIN
ST-BWINCCS /PictureBlocks Page 16 Siemens AG © 2007

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 16 PictureBlocks
Configure Motor_picture, Attributes for Picture Window

Picture window for Motor_1

SITRAIN
ST-BWINCCS /PictureBlocks Page 17 Siemens AG © 2007

Picture Name (1) The name of the picture that is to be displayed in the picture window is entered in
this attribute. In this case, “Motor_Box.pdl” must be selected.

Tag Prefix (2) The tag prefix of the structure that is to be displayed in the picture window is
entered in this attribute. A maximum of 31 picture windows with the same structure
can be connected in one picture. In this example, the variable prefixes Motor_1 – 3
are used for the picture windows 1 – 3.

Heading (3) The text that is to appear in the title of the picture window is entered in this
attribute. Later during the exercise, this attribute will be set with the current tag
prefix via a direct connection.

Display (4) The Static is set to "yes" in this attribute so that the window appears immediately
when the system picture is called.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 17 PictureBlocks
Exercise 2: Show Three Faceplates when Displaying a Screen

Runtime view of the screen Motor_picture.pdl

SITRAIN
ST-BWINCCS /PictureBlocks Page 18 Siemens AG © 2007

Objective In the Motor_picture.pdl, the faceplate "Motor_Box.pdl" is to be displayed in three


different picture windows. The associated structure tags are to be addressed via
the tag prefix (Motor_1. – Motor_3.).
Exercise 1. Define the structure elements of the "Motor" structure as shown in the slide
"Creating a Structure Type in the Project".
2. Create the structure tags for the structures "Motor_1" to "Motor_3"
as shown in the slide "Creating Internal Tags and/ or Process Tags fitting to the
Structure".
3. Use the Graphics Designer to create a new picture named "Motor_Box.pdl"
(picture height: 280, picture width: 190).
4. Configure the steps for the faceplate design as described in the slides
Configure Template, Output Value 1/4" to "Configure Template,
Background Color for Speed Setpont Value 4/4".
5. Use the Graphics Designer to create a new picture designated
"Motor_picture.pdl".
6. Add a button for selecting the picture "Motor_picture.pdl" to the start screen
"Start.pdl". Make a backup copy of the changed start screen
7. Place three picture windows in "Motor_picture.pdl" (position Y: 140,
window width: 200, window height: 350. Select the following values
for position X: 250, 530 and 810). The free space to the left of picture window1
is required for further buttons in the next exercise.
8. Configure the properties of the picture windows as described in the slide
"Configure Motor_picture, Attributes for Picture Window".
9. Back up the created pictures. Start WinCC Runtime and test the
functionality of the newly created pictures.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 18 PictureBlocks
Task: Display Picture Window using Button

SITRAIN
ST-BWINCCS /PictureBlocks Page 19 Siemens AG © 2007

Task The buttons in "Motor_picture.pdl" labeled Motor 1 – Motor 3 can be used to


display or hide the associated picture window. The tag prefix is shown in the
header line.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 19 PictureBlocks
Configure Motor_Picture, Display Picture Window, 1/2

SITRAIN
ST-BWINCCS /PictureBlocks Page 20 Siemens AG © 2007

Action The C-Script describes the toggle function Show/Hide for the picture window.

Note Set the attribute “Display” of the picture window to “no” so that the picture window
does not appear when you select the screen.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 20 PictureBlocks
Configure Motor_Picture, Display Picture Window, 2/2

SITRAIN
ST-BWINCCS /PictureBlocks Page 21 Siemens AG © 2007

Action When the picture window is opened, the tag prefix is read out and copied to the
Heading attribute. Since the object "this object" was used in the direct connection,
the picture window can be copied as often as you like without having to change the
direct connection.

SetPropChar You can create a specific picture window title (heading) with
SetPropChar(lpszPictureName,“Bildfenster6“,“CaptionText“, “Hydraulikpumpe1“).

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 21 PictureBlocks
Exercise 3: Display Picture Window using Button

SITRAIN
ST-BWINCCS /PictureBlocks Page 22 Siemens AG © 2007

Objective The buttons in "Motor_picture.pdl" labeled Motor 1 – Motor 3 are to show or hide
the associated picture window. The tag prefix (Motor_1. to Motor_3. is to be shown
in the header line.

Exercise 1. Open the picture "Motor_picture.pdl" in the Graphics Designer.

2. Add three buttons labeled Motor_1, Motor_2, Motor_3 to the


"Motor_picture.pdl" picture as shown in the figure above.

3. For selecting the picture windows 1 - 3, configure the required C actions at the
buttons for the event "mouse click" as shown in the slide "Configure
Motor_Picture, Display Picture Window, 2/2".

4. Configure the properties of the picture windows for displaying the current tag
prefix as described in the slide "Configure Motor_picture, Title for Picture
Window, 2/2".

5. Back up the picture. Start WinCC Runtime and test the


functionality of the changed picture.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 22 PictureBlocks
Task: A Picture Window with Selectable Tag Prefix

SITRAIN
ST-BWINCCS /PictureBlocks Page 23 Siemens AG © 2007

Task Via the buttons in "Motor_picture.pdl" labeled Motor 1 – Motor 3, User, Machine 1
– 3, the associated picture window can be linked to different data structures. The
data structures contain internal tags and PowerTags from the data blocks DB1 and
DB101-103. The current tag prefix is shown in the header line.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 23 PictureBlocks
Sequence in Instance Formation

Tag prefix:
„Motor_1.“

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

Tag prefix: Tag prefix:


„Motor_1.“ „Motor_2.“

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“.
SITRAIN
ST-BWINCCS /PictureBlocks Page 24 Siemens AG © 2007

SetTagPrefix SetTagPrefix(lpszPictureName,“PictWin1", "Motor_1.");


This function sets the tag prefix of a picture window (e.g. “PictWin1“).
In one picture window, the tag “Actual value” is called in an object. If a tag prefix
"Motor_1." is assigned to the picture window, then the tag "Motor_1. Actual value "
is called. The setting of the tag prefix only becomes effective when the picture
name is reassigned, thus the picture change is omitted.

SetPictureName SetPictureName(lpszPictureName," PictWin1 1",“Motor_Box.pdl");


You have to set the tag prefix before you select the picture and reassign the
picture name, if the picture is not to be changed.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 24 PictureBlocks
Configure Motor_Picture, Attributes for Picture Window

2
3

SITRAIN
ST-BWINCCS /PictureBlocks Page 25 Siemens AG © 2007

Picture Name (1) No name of the picture is entered in this attribute. The dynamics occurs through
SetPictureName();.

Tag Prefix (2) No tag prefix is entered in this attribute. The tag prefix is assigned using the
function: SetTagPrefix(); (or) with a mouse click on the button Motor1 to the left of
the picture window.

Heading (3) The assignment of this attribute is made using the Direct Connection. The Direct
Connection can be seen on the following pages.

Display (4) The Static is set to "no" in this attribute so that the window does not immediately
appear when the system picture is called.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 25 PictureBlocks
Configure Motor_Picture, Title for Picture Window

SITRAIN
ST-BWINCCS /PictureBlocks Page 26 Siemens AG © 2007

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 26 PictureBlocks
Configure Motor_Picture, Button for Selecting the Tag Prefix

SetVisible(lpszPictureName, “PictWin1”,0);
SetTagPrefix(lpszPictureName, “PictWin1”,“Motor_1.”);
SetPictureName(lpszPictureName, “PictWin1”,“Motor_Box.pdl”);
SetVisible(lpszPictureName, “PictWin1”,1);

SetVisible(lpszPictureName, “PictWin1”,0);
SetTagPrefix(lpszPictureName, “PictWin1”,“S7-Program/User.”);
SetPictureName(lpszPictureName, “PictWin1”,“Motor_Box.pdl”);
SetVisible(lpszPictureName, “PictWin1”,1);

SetVisible(lpszPictureName,“PictWin1”,0);
SetTagPrefix(lpszPictureName,“PictWin1”,“S7-Program/Machine3.”);
SetPictureName(lpszPictureName,“PictWin1”,“Motor_Box.pdl”);
SetVisible(lpszPictureName,“PictWin1”,1);
SITRAIN
ST-BWINCCS /PictureBlocks Page 27 Siemens AG © 2007

C Actions Edit the C actions at the buttons as shown in the figure above. Adapt
the tag prefix in the C actions accordingly so that all structure
tags can be displayed in the faceplate.

VBScript Alternatively, the same task can be solved by means of a VBScript instead of a C
action at the action “mouse click”:

Sub OnClick(Byval Item)

Dim objScrWindow

Set objScrWindow = ScreenItems(“PictWin1")

objScrWindow.Visible =vbFalse
objScrWindow.TagPrefix = "S7-Programm/Maschine1."
objScrWindow.ScreenName = "Motor_Box"
objScrWindow.Visible =vbTrue

End Sub

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 27 PictureBlocks
DB101 – DB103, Setting the Operator Control and Monitoring
Attribute (1/2)

Set (at DB101, DB102,DB103)

Context menu -> Special Object Properties, Operator


Control and Monitoring

SITRAIN
ST-BWINCCS /PictureBlocks Page 28 Siemens AG © 2007

Setting the Properties of the DBs


The property "Operator Control and Monitoring" must be set at all three data
blocks (DB101 – DB103). For this purpose, you must open the Operator Control
and Monitoring dialog. This dialog box is opened by right-clicking on the data block
icon and then clicking on the entry "Special Object Properties Æ Operator Control
and Monitoring" in the context menu.
Exit the dialog box by clicking on the "Save" button.

Note The Operator Control and Monitoring attributes are also set if the symbols are
selected from WinCC.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 28 PictureBlocks
DB101 – DB103, Setting the Operator Control and Monitoring
Attribute (2/2)

View: F>View, O>Declaration View

Object
properties

SITRAIN
ST-BWINCCS /PictureBlocks Page 29 Siemens AG © 2007

The flag (only for DBs) shows the user that the Operator Control and Monitoring
attribute is set. This is necessary to ensure that the tags are created in the tag
management of WinCC when compiling the symbols.

S7_m_c true This attribute ("S7_m_c" Æ m: monitoring, c: control) and value ("true") is assigned
if the symbol is to be used for generating the tag.
You can open the dialog box "Properties – Parameters" by right-clicking on the
symbol to be edited (e.g. Speed_ACT) and then clicking on the entry "Object
Properties" in the context menu. The flag becomes visible after exiting the edited
row. The following symbols are used in this exercise:
- Speed_SP
- On_Off
- Direction_SP
- Speed_ACT
- Temperature
Do not forget to save the data block!

Note The Operator Control and Monitoring attributes are also set if the symbols are
selected from WinCC .

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 29 PictureBlocks
Compiling the OS: Start (1/2)

SITRAIN
ST-BWINCCS /PictureBlocks Page 30 Siemens AG © 2007

Compile The "Compile" function must be initiated to create the selected symbols as tags in
the WinCC tag management. It suffices if only the changes are transferred when
compiling.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 30 PictureBlocks
Compiling the OS: Result (2/2)

Tags of data blocks


DB101 – DB103

Structures of
DB 101 - 103

SITRAIN
ST-BWINCCS /PictureBlocks Page 31 Siemens AG © 2007

Result of the "Compile" function


All symbols with the set attribute for Operator Control and Monitoring (flag) have
been generated during the compilation in the WinCC tag management. The three
DBs DB101 to DB103 were created as structure types with their names
"Machine1" to "Machine3". The transferred data blocks can now be displayed in
the left picture window in the motor screen with the faceplate. The tag prefix for the
data of DB 101 is: S7-Program/Machine1.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 31 PictureBlocks
Exercise 4: A Picture Window with Selectable Tag Prefix (1/2)

SITRAIN
ST-BWINCCS /PictureBlocks Page 32 Siemens AG © 2007

Objective Via the buttons in "Motor_picture.pdl" labeled Motor 1 – Motor 3, User, Machine 1
– 3, the associated picture window is to be linked to different data structures. The
data structures are to contain internal tags and PowerTags from the data blocks
DB1 and DB101-103.
The current tag prefix is to be shown in the header line .

Exercise 1. Insert seven buttons to the left of the first picture window as shown in the slide
"Configure Motor_picture, Attributes for Picture Window".

2. Select the attributes for the picture window as shown in the slide
"Configure Motor_picture, Attributes for Picture Window".

3. Configure the display of the current tag prefix in the title of the picture window
as shown in the slide "Configure Motor_picture, Title for Picture Window".

4. Edit the C actions at the buttons as shown in the slide


"Configure Motor_picture, Button for Selecting the Tag Prefix". Adapt
the tag prefix in the C actions accordingly so that all structure
tags can be displayed in the faceplate.

5. Set the "Operator Control and Monitoring" attribute at the data blocks
DB101 to DB 103 as shown in the slide
„DB101 – DB103, Setting the Operator Control and Monitoring Attribute (1/2)".
Without this setting, the data blocks will not be transferred .

6. Set the "Operator Control and Monitoring" attribute (flag) at the symbols
in the data blocks DB101 to DB 103 as shown in the slide
“DB101 – DB103, Setting the Operator Control and Monitoring Attribute (2/2)”.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 32 PictureBlocks
Exercise 4: A Picture Window with Selectable Tag Prefix (2/2)

SITRAIN
ST-BWINCCS /PictureBlocks Page 33 Siemens AG © 2007

Continuation of Exercise 4
7. Start the compile function as shown in the slide "Compiling the OS: Start (1/2)"
In the following slide you can see the newly created tags and structure types.

8. Now start WinCC Runtime and test the function of the seven added buttons for
switching the tag prefix.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 33 PictureBlocks
Faceplate with Process-Relevant Attributes and Central
Changeability

Faceplate type graphic


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

Smart Object:
Connect faceplate
instance to type
graphic
Data records in
the SIMATIC PLC

Structure Type
Editor

SITRAIN
ST-BWINCCS /PictureBlocks Page 34 Siemens AG © 2007

General Faceplates can be used to reduce configuration and administration costs for
similarly structured process objects.

Based on similarly structured data sets in the control (interface description for
function blocks), structure types (e.g. motor, drive, controller block, etc.) are
created once and the tags (instances) are created with the Editor in the WinCC
Explorer.
These tags thus constitute a transfer interface for data from the control for the
faceplate instance in the plant display.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 34 PictureBlocks
Faceplate with Process-Relevant Attributes and Central
Changeability

Runtime view of the graphic Stirring_unit.pdl


Configuring of faceplates

+Create the faceplate template


using Graphics Designer

+Configure the faceplate template


with the required attributes

+VBScript interface

+Edit the local faceplate tags

+Create and dynamize a faceplate


instance

+Central changeability

SITRAIN
ST-BWINCCS /PictureBlocks Page 35 Siemens AG © 2007

Configuring of Faceplates
+ Create the faceplate template using Graphics Designer
+ Configure the faceplate template with the required attributes
+ VBScript interface
+ Edit the local faceplate tags
+ Create and dynamize a faceplate instance
+ Central changeability

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 35 PictureBlocks
Creating and Configuring a Faceplate Type with Individual Objects
1/3

F>Edit, O>Configure Faceplate Type


Edit F>Edit, O>Edit Faceplate Tags

Drag & Drop

Y
Important: adapt picture size in x+y

SITRAIN
ST-BWINCCS /PictureBlocks Page 36 Siemens AG © 2007

Create the fpt type Add individual objects from the object palette of the Graphics Designer. The object
types connector, user object, application window, picture window, and faceplates
cannot be used in the faceplate

Configure the fpt type


Configure the individual objects; i.e. the required properties and events

Create the fpt type "Tags"


Create and edit the required local tags

Dynamization with VBScripts


- With fpt-internal VBScripts, you cannot access data outside of the faceplate
type.
- Therefore there is no access to "HMIRuntime" within a faceplate type
- Debugging is not possible for fpt-internal scripts.
- Fpt-internal tags are accessed in the faceplate type via "SmartTags".
- With "SmartTags" you can access fpt-internal tags and the properties of the
faceplate type.
- See also in WinCC help in the VBS reference chapter “SmartTags object”

Dynamization through Tag Linking


- Only faceplate tags can be used for tag linking.
- Procedure same as for normal tag linking
- Parameters of the local tag: name, data type, start value, low limit,
upper limit

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 36 PictureBlocks
Creating a Faceplate Instance 2/3

Link faceplate instance to .fpt file

SITRAIN
ST-BWINCCS /PictureBlocks Page 37 Siemens AG © 2007

Create the Smart Object ‘Faceplate instance’ and link it to the created .fpt file.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 37 PictureBlocks
Dynamizing and Duplicating a Faceplate Instance 3/3

SITRAIN
ST-BWINCCS /PictureBlocks Page 38 Siemens AG © 2007

Dynamization
All dynamization options can be used
Note
If you select no faceplate type or an invalid faceplate type, the faceplate object is
deleted from the picture.

Changing of Faceplate Types


Changes to type-specific properties in the faceplate type are not updated in the
faceplate instances if the associated process screen of the faceplate instance is
open. Changes are adopted in the instances by closing and reloading the
associated process screen.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 38 PictureBlocks
Exercise 5: Display Three Faceplate Instances in a Screen

Runtime view of the graphic Stirring_unit.pdl

SITRAIN
ST-BWINCCS /PictureBlocks Page 39 Siemens AG © 2007

Objective In the Stirring_unit.pdl, three faceplate instances of the faceplate type


"TypFpt1.fpt" are to be displayed. Dynamization of the faceplate instances is to be
implemented through structure tags (Motor_1. – Motor_3.).
Exercise
1. Copy the picture “Stirring_unit.pdl" from the catalog "ab_exercise"
into the subdirectory GraCS from your project "Control_Room" integrated in
the S7 project (D:\Kurse\WINCCS\Ventilation\wincproj\.....\GraCS).

2. From the catalog ab_exercise, copy the faceplate object "TypFpt1.fpt" into the
subdirectory GraCS from your project "Control_Room"
(D:\Training\WINCCS\Ventilation\wincproj\.....\GraCS) integrated in the
S7 project).

Further configuration steps are described on the following pages.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 39 PictureBlocks
Exercise 5: Creating a Faceplate Instance / Scaling Mode

Link faceplate instance to .fpt file

SITRAIN
ST-BWINCCS /PictureBlocks Page 40 Siemens AG © 2007

Continuation of Exercise 5

3. Create the Smart Object ‘Faceplate instance’ and link this object to the file
TypeFpt1.fpt.
Set the property Other\Scaling mode of the faceplate instance to “1:1”.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 40 PictureBlocks
Exercise 5: Dynamizing a Faceplate Instance / Properties

SITRAIN
ST-BWINCCS /PictureBlocks Page 41 Siemens AG © 2007

Continuation of Exercise 5

4. Connect the three properties to be dynamized as follows:

- ActTemperature -> Motor_1.Temperature

- StateStirringUnit -> Dynamic dialog with tag: Motor_1.Temperature,


as shown in the figure above.

- ActSpeed -> Motor_1.Speed_ACT

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 41 PictureBlocks
Exercise 5: Dynamizing a Faceplate Instance / Event

SITRAIN
ST-BWINCCS /PictureBlocks Page 42 Siemens AG © 2007

Continuation of Exercise 5

5. For the two events to be dynamized, use two direct connections with the
following data:

- For MotorOn Æ Source/constant: "1", target/tag Æ Motor_1.On_Off


as shown in the figure above.

- For MotorOff Æ Source/constant: "0", target/tag Æ Motor_1.On_Off

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 42 PictureBlocks
Exercise 5: Display Three Faceplate Instances in a Screen

Runtime view of the graphic Stirring_unit.pdl

SITRAIN
ST-BWINCCS /PictureBlocks Page 43 Siemens AG © 2007

Continuation of Exercise 5

6. Duplicate the faceplate instance twice and place the faceplate instances as
shown in the figure above

7. Change the tag link so that the three faceplate instances operate with the tags
of the motors 1 – 3. Use the function “Linking/Tag Connections" to adapt the
tag link. You can open the required dialog box by right-clicking on the faceplate
instance and then by clicking on " Linking/Tag Connections ". For rewiring, use
the function “Find and Replace" (replace "_1." by "_2." or "_3." to change the
tag names from Motor_1….to Motor_2…. or Motor_3….).
In the “Find and Replace" dialog, do not forget to click the button "Select all".
Otherwise, the buttons "Preview" and "Replace" will be deactivated. The
rewiring process is implemented and concluded by clicking the "OK" button.

8. Insert an additional button for selecting the stirring unit picture in the start
screen Start.pdl. Save the changed start screen.

9. Save the edited picture "Stirring_unit.pdl". Start WinCC Runtime and test the
functionality of the faceplate instances.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 43 PictureBlocks
Exercise 6: Expanding the Faceplate Type

Runtime view of the graphic Stirring_unit.pdl

SITRAIN
ST-BWINCCS /PictureBlocks Page 44 Siemens AG © 2007

Objective A static text is to be added to the faceplate instances in Stirring_unit.pdl, three


faceplate instances of the faceplate type "TypFpt1.fpt" are to be displayed. The
static text "Motor running" is to be hidden and shown via the buttons "Motor on"
and "Motor off". This function is to be implemented by means of a faceplate-
internal (fpt-internal) tag and VBSript actions at the buttons.

Exercise 1. In Graphics Designer, open the faceplate type "TypFpt1.fpt".

2. Open the dialog box for editing the fpt-internal tag


via: F>Edit, O>Edit Faceplate Tags

3. In the dialog box "Faceplate Tags" create the tag "On_Off" of the data type
"Binary Tag" with the start value "0". Exit the dialog box by clicking on the
"OK" button.

Further configuration steps are described on the following page.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 44 PictureBlocks
Exercise 6: Expanding the Faceplate Type

VBScript at Button “Motor on”, Event “Mouse Action”

VBScript at Button “Motor off”, Event “Mouse Action”

SITRAIN
ST-BWINCCS /PictureBlocks Page 45 Siemens AG © 2007

Continuation of Exercise 6

4. Insert a "Static Text" object in the faceplate type "TypFpt1.fpt". In the properties
of the static text, enter the text "Motor running" under Font/text.

5. Dynamize the visibility of the static text object with the fpt-internal tag "Off_On"
as shown above (property: Miscellaneous/Display).

6. Enter the upper VBScript (see figure above) at the button "Motor on" at the
event "Mouse Action".

7. Enter the lower VBScript (see figure above) at the button "Motor off" at the
event "Mouse Action".

8. Back up the changed faceplate type "TypFpt1.fpt". After a picture change in


WinCC Runtime mode from the "Stirring unit" picture to another picture and
back, you can test the expanded functionality of the changed faceplate
instances (centrally via the faceplate type).

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 45 PictureBlocks
Block Technology with ActiveX Controls
(Option with IndustrialX)

IndustrialX
Basic and WinCC Controls Service Controls

V6

SITRAIN
ST-BWINCCS /PictureBlocks Page 46 Siemens AG © 2007

Configuration toolset to develop picture modules.


The IndustrialX-CD consists of:

- Configuration toolset with Basic and Service Controls


for example, Basic Controls with operator interface
Bar (Graphs)
I/O fields
List Box
etc. (depending of the version)

for example, Service Controls without operator interface


for process connections
for handling messages
for password handling
etc. (depending of the version)

- WinCC Controls and Controls of Others (Demo)

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 46 PictureBlocks

You might also like