04 PictureBlocks PDF
04 PictureBlocks PDF
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
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
- Indirect addressing
- Customized objects
- Faceplate types
SITRAIN
ST-BWINCCS /PictureBlocks Page 3 Siemens AG © 2007
- Blocks
- Static Part
- Dynamic Part
- Action Configuration
SITRAIN
ST-BWINCCS /PictureBlocks Page 4 Siemens AG © 2007
Configuration Preparation
- Indirect addressing
- Customized objects
- Faceplates with tag prefix (picture in picture)
- Faceplate types
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.
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.
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);
Pos. X
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.
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
3. The process tags can be connected via the properties of the Customized
Object.
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.
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).
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
ST-BWINCCS /PictureBlocks Page 11 Siemens AG © 2007
FAQ 16504646 Question: How can I edit a WinCC structure type without having to delete existing
structure tags for this type?
Motor_3
Structure
type Motor
Tags for
instance:
Motor_3
SITRAIN
ST-BWINCCS /PictureBlocks Page 12 Siemens AG © 2007
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".
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:
Member name:
“Speed_SP”
SITRAIN
ST-BWINCCS /PictureBlocks Page 15 Siemens AG © 2007
SITRAIN
ST-BWINCCS /PictureBlocks Page 16 Siemens AG © 2007
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
ST-BWINCCS /PictureBlocks Page 18 Siemens AG © 2007
SITRAIN
ST-BWINCCS /PictureBlocks Page 19 Siemens AG © 2007
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
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
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.
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".
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.
Tag prefix:
„Motor_1.“
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“.
SITRAIN
ST-BWINCCS /PictureBlocks Page 24 Siemens AG © 2007
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
ST-BWINCCS /PictureBlocks Page 26 Siemens AG © 2007
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”:
Dim objScrWindow
objScrWindow.Visible =vbFalse
objScrWindow.TagPrefix = "S7-Programm/Maschine1."
objScrWindow.ScreenName = "Motor_Box"
objScrWindow.Visible =vbTrue
End Sub
SITRAIN
ST-BWINCCS /PictureBlocks Page 28 Siemens AG © 2007
Note The Operator Control and Monitoring attributes are also set if the symbols are
selected from WinCC.
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
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.
Structures of
DB 101 - 103
SITRAIN
ST-BWINCCS /PictureBlocks Page 31 Siemens AG © 2007
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".
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
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.
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.
+VBScript interface
+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
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
SITRAIN
ST-BWINCCS /PictureBlocks Page 37 Siemens AG © 2007
Create the Smart Object ‘Faceplate instance’ and link it to the created .fpt file.
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.
SITRAIN
ST-BWINCCS /PictureBlocks Page 39 Siemens AG © 2007
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).
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
ST-BWINCCS /PictureBlocks Page 41 Siemens AG © 2007
Continuation of Exercise 5
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:
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
ST-BWINCCS /PictureBlocks Page 44 Siemens AG © 2007
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.
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".
IndustrialX
Basic and WinCC Controls Service Controls
V6
SITRAIN
ST-BWINCCS /PictureBlocks Page 46 Siemens AG © 2007