Training Manual: Software For Visual System Control
Training Manual: Software For Visual System Control
Training Manual: Software For Visual System Control
Software for
Visual System Control
This document applies to the following product:
VipWin from version 6.01 on
VipWin is based on the software zenOn of company COPA-DATA.
References in this manual to zenOn are valid for VipWin too!
1999 - 2004- by Festo AG & Co. KG.
1994 - 2004- by COPA-DATA GmbH.
All rights reserved
Distribution and/or reproduction of this document or parts thereof in any form is permitted
solely with the written permission of COPA-DATA or Festo.
The technical data contained herein have been provided solely for informational purposes
and are not legally binding.
Subject to change, technical or otherwise.
Training Manual
VipWin 3
Training: Basic
Contents
Training: Basic 1
Contents.....................................................................................................................................3
General ........................................................................................................................................4
The First Project...........................................................................................................................4
Creating a New Workspace ...........................................................................................4
Creating a new project ..................................................................................................4
Configuration of the Project ..........................................................................................5
Driver............................................................................................................................6
Select and configure drivers .................................................................................................. 6
Simulation Driver................................................................................................................... 7
Data types ....................................................................................................................7
Creating a new simple data type............................................................................................ 7
Creating a new structure data type........................................................................................ 9
Variables ....................................................................................................................10
Creating a new simple variable............................................................................................ 10
Creating a new structure variable ........................................................................................ 12
Templates...................................................................................................................12
Create new template............................................................................................................ 13
Pictures ......................................................................................................................13
New picture ......................................................................................................................... 13
Picture elements.........................................................................................................14
Vect. Elements (Vector) ....................................................................................................... 14
Functions....................................................................................................................16
Function administration....................................................................................................... 16
Dynamic elements ......................................................................................................17
Text button.......................................................................................................................... 17
Picture Functions................................................................................................................. 17
Numerical Value .................................................................................................................. 18
Bar Graph ............................................................................................................................ 19
Trend Graph......................................................................................................................... 19
Indicating Instrument .......................................................................................................... 20
Runtime (Online Operation).......................................................................................................21
Start Runtime .............................................................................................................21
Stop Runtime..............................................................................................................21
Changing and expanding a project.............................................................................................22
Reload ........................................................................................................................22
Changing a project......................................................................................................22
Change setting of values ..................................................................................................... 22
Display variable status ........................................................................................................ 22
Reload changes in the Runtime ........................................................................................... 22
Indirect Picture Addressing.........................................................................................23
Script Organization.....................................................................................................23
The function Send value to hardware............................................................................... 23
The script AUTOSTART......................................................................................................... 24
Runtime......................................................................................................................25
Training Manual
4 VipWin
General
Creating projects defining variables creating templates and pictures static and dynamic elements
The First Project
Creating a New Workspace
HINT:
We recommend to create a new subdirectory with each new workspace. So all important files are in
one directory.
Select the entry New in the menu File. On the propertypage Workspace you can enter the path and the name for
the new workspace.
Enter C:\ as path an then enter the name Workspace. If it does not exist the directory C:\EXAMPLE is created after
confirming the entries of the dialogbox with OK and the file WORKSPACE.WSP6 is written into the directory.
Creating a new project
Select the entry New in the menu File. On the propertypage Project you can enter the path and the name for the
new project. When typing in a projectname it is also use as the default directory.
Enter the projectname PRO1 and accept the default path.
Training Manual
VipWin 5
The following directory structure is created by the editor:
The directories for workspace, project and Editor files as well as the database directory are immediately created. The user
defined directories are created as soon as they are needed. The Runtime directory is created on the first start of the Runtime
resp. on the first time creating Runtime files. If a new project with Alarm- or CEL- (Chronologic Event List) entries is started in
the runtime, zenOn automatically creates a new subdirectory and gives it the name of the computer and the name of the
project. (e.g. C:\EXAMPLE\COMPUTERNAME\PROJECT). In this directory the Alarm- or CEL-entries are stored as BIN files.
PLEASE NOTE:
The directory structure and the files included (even the external files - like e.g. *.bmp, *.jpg, *.txt)
must not be changed by hand.
These files are inserted into the project with the entry "Files" in the project manager and thus automatically copies to the
appropriate directory and stored in the project database.
Configuration of the Project
Select the workspace in the project manager.
In the detail view you now see a list of the projects belonging to this workspace.
Select the project "PRO1" in the detail view.
Now the properties of the project "PRO1" are displayed in the properties window and can be edited there.
We will use this properties window rather often in this training. Generally it offers three views, that can be switched with the
icons on its top:
Quick view Only the most important properties are displayed.
Group view All properties are displayed in logic groups.
All All properties are displayed without groups.
Switch to the group view with the second icon.
Open the section "General".
Workspace
Project working directory
Ediotr files
External editor files
Runtime-files
external Runtime-files
Computer name
Project name
Data of the process
(Alarms, CEL, Archives ...)
Data base directory
Project data base
Training Manual
6 VipWin
Change the property "Main window style" to "no title/full screen".
So the program window of the Runtime will be displayed without a title bar.
HINT:
In the lower part of the properties window you will find a short help for the selected property.
If this help is not displayed, open the context menu of the properties window and activate the entry
"Description".
The property "Start picture" defines the picture, that will automatically be opened when starting the Runtime. As we have
not drawn a picture so far, this property still is empty. As soon as we will have created the first picture in this project, its
name automatically will be entered here.
Driver
To communicate with a data source (PLC field bus, etc.) it is necessary to link a driver. Depending on the needs of the
project the necessary drivers (depending on the PLC) and their process variables have to be created.
For our example we will use a simulation-driver, which automatically changes the values of ist variables, as we have no PLC
in the moment. Would we use e.g. a Siemens driver, without the PLC connected, we would only get error messages.
Select and configure drivers
In the projectmanager activate the context menu of the entry "Variables" with the right mouse button.
Select the menu entry "New drivert..."
The driver selection dioalog opens now.
Training Manual
VipWin 7
Click on the Simulation driver. The entry is written into the field Driver name as shown in the dialog box Definition of
driver.... Confirm the selection with OK.
Simulation Driver
This driver is used to simulate values. The used variables and data are compatible to Siemens-PLCs.
The control of the simulation is done by four Merkers. Therefore the Merker-words from 0 to 3 are reserved. According to the
value of these Merkers the mode, the maximum, the minimum and the increment are set. (e.g. Increment 10 means, that
Simulator-driver counts up from the defined minimum 0 in steps (increment) 0, 10, 20, 30 etc. up the defined maximum
1000)
Merker 0 Mode
0...Simulation stopped
1...Simulation on (up) / Default
2...Simulation on (down)
3...Simulation on (up and down)
Merker 1 Upper limit
0 to 65535
Default = 1000
Merker 2 Lower limit
0 to 65535
Default = 0
Merker 3 Step width
0 to 65535
Default = 10
Data types
Variable on the one hand are based on driver object types and on the other hand on data types.
The driver object types depend on the selected driver. Our simulation driver here ressembles a Siemens S5 driver.
Generally speaking data types are independent of the driver. But not all drivers support all data types. When you are asked
to select a data type, only the data types supported by your driver will be available.
Additionally to the pre-defined data types you can create your own data types. Two possibilities are available here: Simple
data types and structure data types.
Creating a new simple data type
Open the entry "Variables" in the project manager.
Activate the context menu of the entry "Data types" with the right mouse button.
Select the menu entry "New simple data type".
As a name for the new simple datatype enter "Fill level".
Select "UINT" as the basic data type.
With "Finish" the data type is created and now is available in the list of data types.
Select the data type "Fill level" in the list.
In the properties window the properties of the data type "Fill level" now are displayed and we can do the necessary
changes.
Open the groups "Description" and "Value calculation".
Training Manual
8 VipWin
Change the properties "Unit", "Decimals", "Value range PLC" and "Value adjustment linear" of the data type as
shown in the illustration above.
Value range PLC e.g. digital value of the fill level
sensor 12 bit or 16 bit resolution in
the PLC
Value adjustment
linear
e.g. analog value of the fill level
sensor depending on the settings in
the value range PLC is adjusted to
min. 0 l / max. 6553,5 l in the project
We now will define limits for the data type "Fill level".
In the properties window click on the section "Limits" with the right mouse button.
Select the entry "Limits insert" from the context menu.
A new section with the name "Limit[1]" is created.
Open the section "Limit[1]".
Training Manual
VipWin 9
Change the properties of the limit as shown in the illustration above.
Exercise:
Create three more limits for the data type "Fill level":
Limit 2: 2000; MIN; dark blue; no alarm
Limit 3: 4500; MIN; dark red; no alarm
Limit 4: 5500; MAX; light red; alarm
Creating a new structure data type
Open the entry "Variables" in the project manager.
Activate the context menu of the entry "Data types" with the right mouse button.
Select the menu entry "New structure data type".
As a name for the new structure datatype enter "Valve".
After you finished the structure datatype, a dialogbox opens, in which you can create the first structure element of this
datatype.
Training Manual
10 VipWin
As a name for the new structure element enter "Position".
Select "USINT" as the basic data type. The data type should be embedded.
If a basic data type is embedded in a structure data type, the properties of this data type can be changed in the structure
element independently from the basic data type.
After finishing the structure element the structure data type is available in the list.
Now we will create another structure element for this data type.
Activate the context menu of the structure data type "Valve" with the right mouse button.
Select the menu entry "New structure element".
Exercise:
Create another structure element for the structure datatype "Valve":
Auto/Hand: BOOL; embedded
Variables
A process variable is an interface between the data source (PLC, field bus, etc.) and the control system. For the correct
detection and open-loop and closed control of the process it is necessary to have an exchange of process data on the one
hand and the input of setpoint values and commands on the other hand. Process data and settings are defined for single
process variables and the parameters are entered and changed in the variable list.
Creating a new simple variable
In the projectmanager activate the context menu of the entry "Variables" with the right mouse button.
Select the menu entry "New variable..."
The dialog for creating variables opens now.
As a name enter "H1_Tank1".
Select the data type "Fill level".
Confirm the settings with "Finish".
Training Manual
VipWin 11
The variable now is added to the variable list in the detail view of the project manager. All properties of our data type "Fill
level" are pre-defined in the variable. The properties of the selected variable can be checked and changed in the properties
window.
Open the section "Variable".
Change the properties of the variable as shown in the illustration above.
Name this name has to be unique
Identification this name may not be unique
Offset word offset
This variable serves for displaying values.
Exercise:
Create another variable with the following properties:
Name: Mode
Data type: UINT
Offset: 0
Signal resolution: 0..3
measuring range: 0..3
This variable serves for defining the simulation behaviour.
Exercise:
Create the other three simulation variables. Refer to the properties listed further above.
The variable list in the detail view of the project manager now should have two entries.
HINT:
Always use logical names for the process variables in order to keep a better overview.
Training Manual
12 VipWin
Exercise:
Now create new variables for the Simulation driver with the following settings:
"H1_Tank2", "H2_Tank1" and "H2_Tank2" with the same properties as "H1_Tank1" but with the
offset addresses 12, 21 and 22. Change the identification of the variables for hall 2 to "Hall 2".
Creating a new structure variable
Now we will create more variables, but this time for a structure data type. Therefore proceed as described above.
As a name enter "Valve".
Select the data type "Valve".
Set "Dim 0" to the value 4 under "Array dimensions".
As this time we selected a structure data type, two more settings for the variable are available.
Activate the option "Automatic addressing".
Leave the options "Each data type starts with new offset" and "Activate all elements" as proposed by the default.
Now the variables for four valves are created (array dim=4), where each of the four valves consists of two variables (data
type Fill level).
Your variable list in the detail view of the project manager should look like the illustration below:
Templates
A template has to be created before we can draw our first picture. Each picture is based on a template.
Template are the basis for the window technique. Here general settings like ...
Size of template = Size of picture
Training Manual
VipWin 13
Position of the picture on the screen
are done. And so a general layout is created. This offers some advantages like:
A consistent structure of pictures throughout the project
Size and position only has to be stated once
Changing a template will change all the pictures based on it
Functions can especially refer to one template
(Close template, Hardcopy, etc.)
HINT:
Always create two templates at least.
1 template for main pictures
1 template for button bars
Create new template
Open the entry "Pictures" in the project manager and select the entry "Templates".
With "New template" in the context menu you create a new template.
A template with the name "Template_0" is automatically created. In the properties window you can change the settings for
the template.
The size of the template is set to the current screen resolution as a default. We now change these settings, so that some
space is left over on the top and on the bottom of the screen. We need the space at the top for the status line and the one at
the bottom for a leter to create button bar.
Change the properties of the template as shown in the illustration above.
Exercise:
Create a template with the name Button Bar for the button bars. The size of the template should
reach from left/top 0/700 to right/bottom 1024/768.
Pictures
A picture is a window with special predefined properties. Each picture has to be based on a template.
New picture
Select the entry "Pictures" in the project manager.
With "New picture" in the context menu you create a new picture.
A picture with the name "Picture_0" is automatically created. In the properties window you can change the settings for the
picture.
In the section "General" enter the picture name "Start Pic" and make sure, that the picture is of the window class
"Standard".
Training Manual
14 VipWin
In the group "Template" make sure, that the picture is linked to the template "Process picture".
Open this new picture with a doubleclick on the picture name in the detail view of theproject manager or by opening
the context menu and selecting the entry "Open picture".
Exercise:
Now create a picture with the name "Hall". Also this picture should be linked to the template
"Process picture".
Now create a picture with the name "BB-Start". Link the template "Button bar" to this picture.
Picture elements
Generally speaking there can be two different types of elements, that can be used in a picture.
Vector elements The outer appearance of these elements in the Runtime
always stays the same.
Dynamic elements These elements change their outer appearance in the
Runtime (usually depending on the value of a variable).
Vect. Elements (Vector)
Text
We now will enter text into our START_PIC:
Open the menu "Vect. Elements".
Select the vector element "Text".
With the left mouse button pressed down you now draw a text element (rectangle) on the picture START_PIC (ca. 3
cm high and 7 cm wide). The text element now is marked with the selection marks.
The parameters of the element can now be changed in the properties window. If you want to change the properties lateron,
you only have to select the element in the picture - by clicking it with the left mouse button. Then the properties are again
available in the properties window.
This procedure is the same for all elements.
In the field Representation/Text you now write My first project.
Now we will create a new font for our text element.
Select the entry "Fonts" in the project manager.
Open the context menu in the detail view an select the entry "New font".
The Windows standard dialog for the definition of fonts opens now.
Training Manual
VipWin 15
Now select Arial bold 24 and confirm the settings with OK.
The detail view of the project manager now lists "New font 1" and the properties window shows the properties of the new
font.
Change the name of the font to "Title".
The fonts selected here can be used in all elements that include text.
We now will use this font in our text element.
Select the text element in the starting picture and open the section "Font" in the properties window.
Select the right column of the property "Font".
The dialog for the font selection opens.
Select the font "Title".
Click the icon "Save picture" or select the entry "Save picture" from the context menu of the picture.
Training Manual
16 VipWin
HINT:
As this is the first picture, we saved, ist name is automatically entered into the project-configuration
as the start picture.
Functions
The new pictures are opened by buttons of a button bar. Additionally we will offer appropriate button bars for the different
windows.
Operating the project is done with functions.
Function administration
All available functions are offered by the functions list.
Select the "Functions" in the projectmanager.
In the detail view of the project manager you now can see an empty function list. Here the functions created by you will be
listed lateron.
Open the context menu in the detail view an select the entry "New function".
A dialog with the pre-defined functions opens. The functions here are sorted in sections.
First we will create a function to close the Runtime.
Open the section "Application - functions".
Select the function Exit program and confirm the selection with OK.
The function now is listed in the function list in the detail view of the project manager and can be changed in the properties
window.
This function does not have any parameters, so that the definition is finished here.
Next we will create functions for switching pictures.
Open the context menu in the detail view an select the entry "New function".
Open the section "Picture - functions".
Select the function Picture switch and confirm the selection with OK.
As this function needs parameters, now the dialog to enter the necessary parameters automatically opens.
This function needs the picture to be opened as a parameter.
Select the picture Start and confirm the selection with OK.
No more parameters are needed, so the definition of this function is finished.
Training Manual
VipWin 17
Exercise:
Create the corresponding picture switch functions for the pictures "BB-Start" and "Hall".
Dynamic elements
Other than vector elements, dynamic elements change their outer appearance in the Runtime.
Dynmic elements are used to display variable values or to execute functions.
Text button
First we will create buttons for our button bar "BB-Start" to switch between the pictures "Start Pic" and "Hall".
Open the picture BB-Start.
Select the command Text Button from the menu Dyn. Elements.
With the left mouse button pressed down you now draw a dynamic element on the picture BB_START (1.5 cm high
and 3 cm wide).
Open the section "Text" in the properties window.
For Line 1 enter the text "Start" and for Line 2 the text "Alt S".
Now switch to the section "Element".
Click on the right column of the property "Function".
The dialog for the function selection opens.
Select the function "Picture switch - Start".
Click on the right column of the property "Key combination".
The dialog for the definition of the key combination opens.
In the Runtime you now can execute the function either by clicking the button or by pressing the key combination.
As kex combination enter "Alt S" simply by clicking into the input area and pressing that key combination.
Confirm the entry with OK.
Exercise:
Create a corresponding button for the picture "Hall" with the text "Hall 1" and "Alt 1" and the
according key combination.
Create another button for the function "Exit program" with the text "Exit" and the key combination
"Alt E".
HINT:
We recommend to define an own font for the text of the button and to use this font for all buttons in
the project. If you want to change the size or any other attribute of the font at a later moment the
changes then will influence all buttens automatically.
Picture Functions
With each picture you can link functions, that automatically are executed on opening or closing the picture. We will use this
functionality now to open the button-bar with the start picture.
Select the "Pictures" in the projectmanager.
In the detail view of the project manager select the picture "Start Pic".
Training Manual
18 VipWin
Open the section "General/Functions" in the properties window.
In "Start function" select the function "Picture switch: BB-Start" from the list.
Whenever the START_PIC is opened in the Runtime now, the appropriate button bar is also opened.
Numerical Value
Open the picture START_PIC.
Select the command Numerical value from the menu Dyn. Elements.
With the left mouse button pressed down you now draw a dynamic element on the picture START_PIC (ca. 2 cm high
and 5 cm wide).
Now the dialog for the variable selection opens.
In the dialogbox Variable selection highlight the variable Mode and then press the button OK.
In the properties window activate the option "Display unit".
In order to change the size of a dynamic element you click on one of ist markers (the cursor is a double arrow, you hold
the left mouse button pressed down and by moving the mouse change the size of the element.
In order to move a dynamic element you click on it (the cursor is an arrow cross), you hold the left mouse button
pressed down and drag the element to ist new position.
Click the icon "Save picture" or select the entry "Save picture" from the context menu of the picture.
Training Manual
VipWin 19
Exercise:
Create further numerical value elements for the upper limit, the lower limit and the step width of the
simulation driver.
Bar Graph
Open the picture Hall.
Select the command Bar Graph from the menu Dyn. Elements.
With the left mouse button pressed down you now draw a dynamic element on the picture HALL (ca.7 cm high and 3
cm wide).
In the dialogbox Select variable highlight the variable H1_Tank1 and then press the button OK.
Under "Representation/Colours" set the "Bar colour" to blue.
This bar colour is used as long as no limit violation occurs. As soon as a limit is violated, the colour of the limit is taken
instead of the bar colour defined here.
Trend Graph
Select the command Trend Graph from the menu Dyn. Elements.
With the left mouse button pressed down you now draw a dynamic element on the picture HALL (15 cm high and 20
cm wide).
This dynamic element does not ask for a variable immediately. The reason is, that more than one variable can be selected
for this element.
Click into the properties window with the right mouse button, which opens the context menu.
Select the entry Curves insert.
In the dialogbox Variable selection highlight the variable H1_Tank1 and then press the button OK.
Repeat this procedure selecting the variable "H1_Tank2" this time.
In the properties window you now will find the new section "Curves".
VipWin
Training Manual
20 VipWin
In the properties window open the section "Curves" and then "Curve[1]".
Change the "Text for trend with curve info" to "Tank 1".
For "Curve[2]" change the text to "Tank 2".
Indicating Instrument
Select the command Indicating Instrument from the menu Dyn. Elements.
With the left mouse button pressed down you now draw a dynamic element on the picture HALL (15 cm high and 20
cm wide).
Highlight the variable H1_Tank2 in the dialogbox Select variable and then press the button OK.
In the properties window open the section "Representation" and then "Scale".
Set the "Main ticks" to 100 and the "Sub ticks" to 200.
So there will be a long tick with the value at every 1000 and a short one with out value every 200.
So, and now it is time to have a look at our project in the Runtime.
Training Manual
VipWin 21
Runtime (Online Operation)
Start Runtime
The Runtime can be started in four ways:
The command Start runtime in the menu Option
Clicking on the button start runtime
In the start menu in the folder "Programs/COPA-DATA/zenOn600" with the entry "zenOn
Runtime"
With the key "F5" from the Editor
After the Runtime is started, two pictures are loaded. First the picture START_PIC (because it was automatically entered in
the configuration as the Starting picture) and the picture BB_START (because it is opened via the start function of the
picture START_PIC).
First we will learn how to get a better overview in an existing Runtime project.
Click into an empty area of the picture with the right mouse button.
If you keep the mouse button pressed long enough the name of the picture appears at the mouse pointer.
Now click on the numerical value element for the variable "Mode" with the right mouse button.
To the left just above the element the name of the linked variable is displayed now.
Now click on the numerical value element for the variable "Upper limit" with the left mouse button.
The standard dialog for settings values opens and allows you to change the value of this variable.
Set the value of the variable "Upper limit" to 65535 and close the dialog with "OK".
Set the value of the variable "Step width" to 1000 and close the dialog with "OK".
With the buttons "Start Pic" and "Hall 1" in the button bar you can switch between the two process pictures.
Switch to the picture "Hall 1" and watch the behaviour of the dynamic elements there.
The simulation is switched on and the bar of the bargraph moves.
Switch back to the "Start Pic".
Set the value of the variable "Mode" to 0 and close the dialog with "OK".
Switch back to the picture "Hall 1" and watch the change in the behaviour of the dynamic elements there.
Stop Runtime
Press the button "Exit" to close the Runtime.
If no button is defined to close the Runtime and the Windows title bar is not available, the Runtime can also be closed with
the key combination "Alt F4".
Training Manual
22 VipWin
Changing and expanding a project
Reload
We now will learn about the function "Reload", which allows us to change the project without always having to close and
restart the Runtime. This functionality allows to make changes in the Editor while the Runtime is running. These changes
then can be reloaded in the Runtime.
From the context menu of the "Functions" select the entry "New function".
Select the function "Reload" from the section "Application - functions".
In the properties window you see, that the parameter "changes objects" is proposed as a default. I.e. on executing this
function not all but only the changes objects are reloaded.
Open the picture BB-Start.
Create a new button with the text "Reload", that executes the function "Reload".
Start the Runtime.
Switch back to the Editor with the Windows task bar or the key combination "Alt Tab".
After the next changes in our projects we will see how to use the function "Reload".
Changing a project
Change setting of values
Open the picture START_PIC.
Select the numerical value element for the "Mode".
Open the section "Set value" in the properties window.
Change the property "Set value via" to "Element".
Now on changing the value of the variable "Mode" the standard dialog will no longer be opened in the Runtime. Instead we
can enter the set value directly in the element.
Display variable status
Open the section "Representation" in the properties window.
Activate the property "Display status".
Whenever the connection to the PLC gets lost, this will be indicated in the dynamic element. In the upper right corner of the
element a coloured square will then appear. This square can have two different colours:
invisible The connection to the PLC works.
red The connection is interrupted between driver and PLC.
blue The connection is interrupted between zenOn and driver.
Additionally the status of the variable is displayed, when you click on the element with the right mouse button in the
Runtime and keep the mouse button pressed.
Reload changes in the Runtime
Before we can reload the changes in the Runtime, we have to save the picture and then to create new Runtime files.
Click the icon "Save picture" or select the entry "Save picture" from the context menu of the picture.
Generally there are two possibilities to create new Runtime files. All Runtime files can be newly created or only those that
were changed.
New Runtime files can be created via the context menu of the project in the project manager or with the according icons in
the icon bar.
Open the context menu of the project by clicking at the name of the project in the project manager with the right mouse
button.
Select the entry "Create Runtime files".
Or:
Click on the icon "Create Runtime files".
Thus we have created new Runtime files. Now we still have to reload the changes in the Runtime.
Switch to the Runtime with the Windows task bar or the key combination "Alt Tab".
Press the button Reload.
Training Manual
VipWin 23
Indirect Picture Addressing
With the help of the indirect picture addressing existing pictures can be reused. This functionality allows to substitute
variables and functions of a picture when opening it. So for equl equipments only one picture has to be created; this picture
can be opened with different sets of variables and/or functions via different picture switch functions.
Create a new function "Picture switch".
Select the picture Hall and confirm the selection with OK.
On selecting the picture zenOn finds out, that this picture already contains variables and/or functions. So another dialog is
opened automatically.
In the lower part of the dialog "Substitute links" you see the variables and functions contained in the picture. (Our picture
Hall has no functions.) By doubleclicking one of the lines you can substitute a single variable. But as we have an universal
variable name structure in our project, we can substitute entire groups.
As a source enter "H1*".
As a target enter "H2".
Press the button "Accept" and confirm the following prompt with "Yes".
In the lower part of the dialog you now can check, if the substitutions are the desired ones. In our example all variables
whose names start with "H1" are substitutet with variables whose names start with "H2".
Close the dialog with "OK" and answer the following two prompts with "Yes".
Create a new button in the picture "BB-Start" named "Hall 2" and executing the function created just before.
Script Organization
If several functions should be combined and be executed in the defined order (similar to a batch file), they can be entered
into a script. There are some reserved names in the system for scripts, that are automatically executed at system start and
system stop.
AUTOSTART script is automatically executed on starting the Runtime
before opening the starting picture
AUTOEND script is automatically executed on closing the Runtime
We now want to change the settings for the upper limit and the increment of the Simulator driver automatically in the
AUTOSTART script. Therefore we first need the appropriate functions.
The function Send value to hardware
Create a new function.
Open the section "Variable - functions".
Select the function Send value to hardware"
Select the variable Upper Limit and confirm the selection with OK.
As this function needs additional parameters, a further dialogbox opens now.
Training Manual
24 VipWin
Set the value to 65535.
Activate the option Direct to hardware.
This option has the effect, that the entered set value is directly sent to the hardware (=PLC) without giving the user the
oportunity to change the value in the Runtime.
Exercise:
Define a function Send value to hardware for the variable Increment and set the value to 100.
The script AUTOSTART
Select the "Scripts" in the projectmanager.
Open the context menu in the detail view an select the entry "New script".
Give the new script the name "AUTOSTART".
With a click on the "+" in front of the script name the functions list of the script "AUTOSTART" is opened.
Open the context menu of the "Function list" in the detail view an select the entry "Add function".
The dialog for the multiple selection of functions opens.
Training Manual
VipWin 25
Select the two functions "Send value to hardware" by either doubleclicking them or by selecting them and pressing the
button "Add".
As soon as both functions appear in the lower part of the dialog, confirm the selection with "OK".
The functions of the script now also are listed in the detail view of the project manager.
Runtime
After the Runtime is started, two pictures are loaded. First the picture START_PIC (because it was automatically entered in
the configuration as the Starting picture) and the picture BB_START (because it is opened via the start function of the
picture START_PIC).
Now the following buttons should be in your button bar:
Start Pic (Alt S) opens the starting picture
Hall 1 (Alt 1) opens the picture "Hall"
Hall 2 (Alt 2) opens the picture "Hall" and displays the values
of hall 2
Reload updates new project data online
EXIT Online operation (Runtime) is stopped