05 Graphics Designer Part2 en
05 Graphics Designer Part2 en
05 Graphics Designer Part2 en
Here, you can check whether a PROFIBUS connection between the PC and the
S7 exists. The PROFIBUS addresses can also be recognized.
Tip With "View with DP Slaves / IO Devices", these devices can be made visible in
the NetPro view
2. If no connection has yet been created for the controller and if the interface is
not unique, the dialog "Select the Network Connection" opens automatically, In
this case, please select the WinCC unit "PROFIBUS".
3. After this configuration step, an I/O field with the required tag has been created.
1. Click on the tag with the mouse and then holding down the mouse button drag it
to the Properties tab. This tab is then shown.
2. Then while still holding down the mouse button, go to the lamp symbol beside
the property to be dynamized and release the mouse button there.
3. The result is shown in the figure above. The tag is used to dynamize Position X.
"Update" column Here, the update time can be adapted. With the procedure above, the default time
(2 s) is entered automatically. The default time can be changed in Tools/Settings -
> "Default Object Settings" tab.
Direct/Indirect To dynamize a graphics object, the indirect addressing of tags can also be used.
To do this a tag (address tag) is defined that contains the tag name of the target
tag.
By changing the content of the "address tag" it is possible to access different tags.
This also changes the link of the tag to the I/O field.
Indirect addressing is indicated by a check mark being entered for "Indir." in
addition to the tag when it is double-clicked.
With indirect addressing, the tag entered there must be a text tag.
Note The dynamization of an object linked to a tag is indicated by a green lamp signal.
2. Select the object and go to the object properties. Find the attribute "Value"
there. Open the shortcut menu of this attribute and select "Tag".
3. In the tag box, find the data block "User" and the "P_speed_actual" tag
4. Change the update time to 1 second. Afterwards the row should appear as
follows:
5. You can set the attributes (such as maximum value, tick width, danger,
warning,...) of the gauge control with properties. With controls, it is often easier to
use its own properties dialog. To do this please click on the control.
6. In the start picture (in the overview area) configure the system function "Exit
WinCC Runtime" on an additional button with the Dynamic Wizard of the
Graphics Designer.
Dynamic Wizard
The Dynamic Wizard makes it easier for you to use and configure complex objects
such as I/O fields and bars because all the required parameters are queried by the
wizard. These are then entered in the object properties and can also be adapted
later individually.
The Dynamic Wizard always generates a C script. The Dynamic Wizard can be
set with P>View, O>Toolbars.
Tag connection
If tags need to be displayed 1 to 1, the direct tag connection of internal and
process tags is available that can also be addressed indirectly.
Dynamic dialog
As a convenient option for dynamizing objects, you can also use the Dynamic
dialog. Here, it is very easy to configure color changes if various limits are
exceeded.
Using the Dynamic dialog results in high performance in
runtime mode.
Two examples are shown in the figure: Configuration dialog for an I/O field and for
a button. Not all objects have such a dialog.
For changes: Open the shortcut menu with the right mouse button and start the
configuration dialog.
The wizards are distributed on different tabs according to different topics. In the
"System Functions" tab, there are for example wizards for language switchover in
WinCC Runtime or to exit WinCC Runtime.
First, the object to be dynamized must be selected. Then the required wizard is
started by double-clicking on it. Here, one or more screens may be displayed with
questions. On completion of the wizard, this has generated a C script for
dynamization.
Tag Select an object in the picture --> display the Object Properties --> select the
Properties tab --> open the shortcut menu by right clicking in the Dynamic column
->> select a tag --> select the corresponding tag in the dialog and adopt it.
The tag connection is used when the value of a tag is required to influence the
property of an object directly (example: Tag has the value 120 and is linked to the
X position of the graphics object, this is then displayed at X position 120).
Dynamic dialog The dynamic dialog can be used for more complex dynamics. For details, refer to
the next pages.
Direct connection With events a direct connection can also be used. For details, refer to the next
pages.
C Action
VBS action When a solution is not possible with the Dynamic dialog or a direct connection,
scripts can be programmed in the programming language "ANSI C" or "Visual
Basic Script". Details are discussed in section 5.
Configuration The configuration of the Dynamic dialog is started with the right mouse button on
the lamp symbol. (Shortcut menu for the object property).
The results of the query are therefore linked immediately to the connected
property. In the example above to "Position X".
Changes If changes need to be made, these can be integrated easily in the existing dialog.
(Open the Dynamic dialog again using the shortcut menu).
Note If the attribute was dynamized with a Dynamic dialog, the lamp symbol is replaced
by a red lightning symbol.
However an unsigned 16-bit value can also be used. If this equals zero, this
corresponds to "False", if it is not equal to zero "True".
Tag status Dynamizing by using the Dynamic Dialog can also be used to monitor the status of
a WinCC tag in Runtime. With external tags, monitoring the tag status also allows
conclusions to be made about the status of the associated connection.
The picture shows the direct connection between the value of a mouse operation
and the writing of a tag.
It is also just as easy for example to configure a direct change to another picture or
similar. As of WinCC V5, the direct connection is displayed at the target object via
the object properties and is recognizable by the italic font.
Note If a direct connection was configured, the lightning symbol is shown in blue.
3. Draw a polyline between the toggle button and the motor. In a Dynamic
dialog, dynamize the line color depending on the S7 program(1)/ user.on_off
(0= black, 1= red)
4. Configure the three setpoint buttons for changing the setpoint speed
400, 900 and 1200 revolutions. Use the direct connection with the tag "S7
program/User.Reference_speed".
Output Format Here you define how many places the number can have before or after the point.
Examples for "Decimal":
- 999.9 3 places before the point, one place after the point
- s9.99 one place before the point, two places after the point, signed, necessary
with negative numbers
- 0999 3 places before the point with leading zeros, 3 is displayed as 003
- 99.9e number is displayed in exponential notation
Examples for Binary:
- 1111 4 places
- 01111 4 places with leading zeros
Tip: By double-clicking on "Output Format" a list with various options is displayed.
Clear on New Input
If you click in the field, the old value is deleted.
Procedure From the object palette, Smart Objects group, select a bar
and configure this in your graphics picture with the configuration dialog.
You will find the other necessary settings in the figure above.
Scale marks With this, the number of labels on the axis can be specified. Zero means that the
scaling is performed automatically.
With the first of these, no scaling can be displayed, with the WinCC slider control
this is possible.
As with almost all controls, there is a properties box that can be opened by double-
clicking.
If a tag is to be linked, this is only possible in the Object Properties with the
"Position" attribute.
Exercise 1. Configure a WinCC slider object (Controls palette/ActiveX controls) and connect
it to the tag "S7 program(1)/ User.Reference_speed
(Object Properties: Control Properties / Position). Also change the scaling
to the value range: 0 to 1400
3. Configure the lower display limit with 00 and the upper limit with 1400.
4. You can set the attributes (such as font size, number of places, color...) of the
bar in the Properties.
AH = Alarm High
WH = Warning High
Procedure - You require different graphics files that, for example, represent a valve differently.
These graphics files could also be generated with the Graphics Designer
(File/Export... -> generates an EMF file or with the aid of a hardcopy). Or they can
also be generated with other tools (e.g. Paintshop Pro, ...).
1. From the object palette via the "Smart Objects" node, select the
status display and place it in the picture.
2. In the shortcut menu of the State:, select "Add" (2b), this generates the states 0,
1, 2, 3, 4, ... If you select further states with the "Add" button, these are bit coded:
0, 1, 2, 4, 8,
3. Then drag the graphic file name to the Basic Picture column and possibly a
flashing picture. If the flash attribute is set to "Slow", "Medium" or "Fast", the basic
picture and the flashing picture will be displayed alternately.
4. Select the required tag and your update time.
Exercise 1. From the global library under Operation/Toggle Buttons select a suitable switch
or copy the existing On/Off toggle switch. Then link the tag
S7 program/User.Direction_reference with the property Tag
Assignment/Toggle Bit. (Check this property to make sure that the check mark
is not set in the "Indir" column.)
3. In the configuration dialog of the status display that then appears, the required
graphics files must first be added to the list using the "Browse" button. The two
files "left.emf" and "right.emf" can be found in
D:\Courses\WINCCS\ab_exercise.
4. From the picture selection window, select your files ("left.emf") and
"right.emf" and place these by dragging them to the status table, Basic Picture
column (0=left, 1=right).
The color code is made up of the three color portions red, green and blue.
Analog Several value ranges can be defined. With "Add", a further value range can be
added. The corresponding value for the property to be dynamized is entered in the
right-hand column. In the example above, the background color is dynamized.
In the VBS example above, a color change to red is output when the current value
for the tag Direction_actual is one and at the same time the actual speed is higher
than 1200. If this is not the case, the graphics object is colored green.
Example Each switching action for a coupling causes a bit to be set and reset in a word. For
this, bit addresses 0-3 are used, the bit addresses 4-15 can be used for other
operations in the control program.
Procedure In the data manager, the tag "Line" is defined as an unsigned 8-bit value.
In the following exercise, the control buttons for lines 1 and 2 are
inserted in the Motor picture. The coupling status is represented by an I/O field
with the bit pattern of the Line tag.
Exercise 1. Insert the four buttons and the I/O field at the bottom left in the Motor picture.
3. Connect the I/O field with the "Line" tag and select the following
settings:
- Field Type: Output
- Output Value: Line
- Update Cycle: On change
- Data Format: Binary
- Output Format: 011111111
4. Call the Dynamic Wizard for each window button and generate the function
Setting/Resetting a bit for bits 1 and 2.
Example The adjustment value (control range) of the slider object will be between 0 and
100.
In the example above, a tag still needs to be specified that will be adjusted using
the slider.
Procedure The slider object is created in the picture using the object palette, the size
can be set using the handles.
It is labeled by the user.
The entry of the labeling texts e.g. "1st bit" is sequential; in other words first set the
index to 1 then enter the first text, then set the index to 2 and enter the second text
etc.
The radio box can if necessary also display several set bits if these have been set
by the PLC program. The operator cannot set more than one bit.
The text list can be defined as an input list, an output list or as a combined
input/output list.
List box The list box makes it possible to highlight one of several values of a scrollable list
and to use the selection as an input.
The entry of the labeling texts (e.g. "1st bit") is sequential; in other words first set
the index to 1 then enter the first text, then set the index to 2 and enter the second
text etc.
Runtime If the value of the connected tag changes, the assigned text is displayed.
If the operator selects one of the texts from the list, the value of the connected tag
also changes.
Example The help texts are based on the technological application and inform
the operator for example about adjustment ranges or tank temperature.
Option 1 Individual help texts are shown and hidden by clicking with the mouse. This can be
achieved as shown in the example above with two buttons or using an object with
press mouse/left -> help text visible and release mouse/left -> help text invisible.
Option 2
Tooltip The "Tooltip text" attribute specifies the tooltip text to display in Runtime by
positioning the mouse pointer on the object. The tooltip text can be entered in
several languages.
With the control character \n, the tooltip text can also be shown on several lines.
Option 3 If it should be possible to make several objects visible or invisible at the same
time, this is achieved most easily with a VBS script. With this, all objects for
example on layer 5 can be switched visible or invisible at the same time. Details
follow in the next section.
Exercise 1. Call-up the Motor picture and take the object Multiple row text from the Smart
Objects and edit a static text with the information text: "The maximum setpoint
speed is 1350."
Adapt the font size and colors. The object name should be Help text.
The property Miscellaneous/Display must be set to no.
2. Configure a round button and under Events Mouse/Press Left the following
direct connection:
- Source: Constant 1
- Target: Object in picture, Help text , Display
3. For the round button also under Events Release Left the following direct
connection:
- Source: Constant 0
- Target: Object in picture, Help text , Display
4. Configure the tooltip text for the input field for the setpoint speed.
C script:
Procedure Procedure To display the current file name in the picture, it is adequate to
configure a static text with which the text display is dynamized by a small C action.
In the return value, the call parameter lpszPictureName of the C action is simply
returned.
Configuring properties:
Static text / font / text / C action:
return lpszPictureName;
This static text can be copied into every picture and displays the current name of
the picture in runtime.
When necessary, the visibility can be controlled by a central internal tag so that
picture name output can be suppressed.