Functions_and_scripts V8.20
Functions_and_scripts V8.20
Distribution and/or reproduction of this document or parts thereof in any form are permitted solely with
the written permission of the company COPA-DATA. Technical data is only used for product description
and are not guaranteed qualities in the legal sense. Subject to change, technical or otherwise.
Contents
3 Functions ...................................................................................................................................................... 6
3.1 Context menus and toolbar ......................................................................................................................... 6
3.2 Overview functions in zenon........................................................................................................................ 8
3.2.1 Favorites ...................................................................................................................................................................... 9
3.2.2 Add-In .......................................................................................................................................................................... 9
3.2.3 AML and CEL.............................................................................................................................................................. 9
3.2.4 Application .............................................................................................................................................................. 11
3.2.5 Historian ................................................................................................................................................................... 13
3.2.6 Batch Control .......................................................................................................................................................... 14
3.2.7 User Administration ............................................................................................................................................. 15
3.2.8 Screens ...................................................................................................................................................................... 15
3.2.9 Fault locating in electric grids .......................................................................................................................... 18
3.2.10 Message Control ................................................................................................................................................... 18
3.2.11 Network .................................................................................................................................................................... 19
3.2.12 Report Generator / Report Viewer / Analyzer ........................................................................................... 19
3.2.13 Recipes ...................................................................................................................................................................... 33
3.2.14 Command Sequencer.......................................................................................................................................... 33
3.2.15 Shift Management ................................................................................................................................................ 34
3.2.16 Script .......................................................................................................................................................................... 34
3.2.17 Variable ..................................................................................................................................................................... 35
3.2.18 VBA ............................................................................................................................................................................. 36
3.2.19 VSTA ........................................................................................................................................................................... 37
3.2.20 Windows ................................................................................................................................................................... 37
3.3 Engineering in the Editor.............................................................................................................................38
3.3.1 Creating and editing functions........................................................................................................................ 38
3.3.2 Selecting a function ............................................................................................................................................. 39
3.3.3 Deleting functions ................................................................................................................................................ 40
3.3.4 Inserting functions from other projects ....................................................................................................... 40
3.4 System functions ............................................................................................................................................40
3.4.1 Application - functions ....................................................................................................................................... 40
3.4.2 Windows - Functions ........................................................................................................................................... 45
3.5 Functions in the network .............................................................................................................................52
3.6 Execution sequence during Runtime ......................................................................................................59
4 Scripts .......................................................................................................................................................... 65
4.1 Context menu and toolbar for scripts ....................................................................................................65
4.2 Engineering in the Editor.............................................................................................................................67
4.3 Pre-defined scripts .........................................................................................................................................68
4.4 Executing scripts in Runtime ......................................................................................................................71
4.5 Priorities in the network...............................................................................................................................73
ZENON VIDEO-TUTORIALS
You can find practical examples for project configuration with zenon in our YouTube channel
(https://www.copadata.com/tutorial_menu). The tutorials are grouped according to topics and give an
initial insight into working with different zenon modules. All tutorials are available in English.
GENERAL HELP
If you cannot find any information you require in this help chapter or can think of anything that you
would like added, please send an email to [email protected].
PROJECT SUPPORT
You can receive support for any real project you may have from our Support Team, who you can
contact via email at [email protected].
5 | 78
Functions and scripts
Runtime.
3 Functions
All functions used in a project are based on the existing system functions. These are pre-defined macros
that are easy to use and parameterize by the user.
PROJECT MANAGER
Menu item Action
Display unused functions Creates a project analysis for unused functions in the current
project and displays it as result list in an own window.
6 | 78
Functions
Open in new window... Opens a new window in order to view and edit the function.
The window is displayed at the lower edge of the Editor as a
default setting. This can be moved as desired.
Editor profile Opens the drop-down list with predefined editor profiles.
DETAIL VIEW
Toolbar and context menu
Paste Pastes the content from the clipboard. If an entry with the
same name already exists, the content is pasted as "Copy
of...".
Function use... Creates a project analysis for selected functions in the current
project and displays it as result list in an own window.
Edit selected cell Opens the selected cell for editing. The binocular symbol in
the header shows which cell has been selected in a
highlighted line. Only cells that can be edited can be
selected.
Replace text in selected column Opens the dialog for searching and replacing texts.
7 | 78
Functions
Information
The functions available in zenon depend on the license.
8 | 78
Functions
3.2.1 Favorites
This group contains functions that you have defined as favorites.
3.2.2 Add-In
This group contains functions for the handling of Add-ins.
Function Description
Display dialog "Manage Opens the dialog to manage the services in Runtime.
Runtime services"
More in chapter:Display dialog "Manage Runtime services”:
Alarms: acknowledge flashing This function acknowledges the flashing of all elements of the
currently open screen of a selected frame.
Alarm/event group log in/log This function signs the variables of the alarm/event group in
off or out with the driver.
9 | 78
Functions
Function Description
Alarm Message List active This function activates the entire alarm message list.
Alarm Message List This function activates/deactivates the entire alarm message
active/inactive list.
Alarm Message List inactive This function deactivates the entire alarm message list.
Export AML This function exports filtered entries of the alarm message list
to an external format.
Save AML and CEL ring buffer This function saves current alarms and events to file
ALARM.BIN and CEL.BIN and values from the mathematics
variables (counter) in file SY_MA32.BIN.
Export CEL This function exports filtered entries of the Chronologic Event
List (CEL) to an external format.
Print AML or CEL This function prints selected entries of the alarm list (AML) or
the Chronological Event List (CEL).
Create/print IPA document This function creates an IPA report and writes it to an HTML
file or prints it out.
Switch online printing on/off This function switches on/off online printing of the alarm
message list or the Chronological Event List (CEL).
10 | 78
Functions
Function Description
Online printing start new In activated online printing this function finishes a page and
page starts a new one. The page number is reset to 1.
Switch online printer This function switches the online printing to a selected
printer. Optionally, a dialog for the user can be opened
before that.
3.2.4 Application
This group contains functions for the handling of project settings.
Function Description
Select printer This function opens a dialog in which the user can select printers
for the different print tasks.
Print Extended Trend You can print out Extended Trend diagrams or save them to a
diagram file (JPG or BMP) using this function.
Functions active at limit This function activates the function administration. Automatically
values executed functions (e.g. via time control, limit value violation,
etc.) are executed.
11 | 78
Functions
Function Description
Functions inactive at limit This function switches the function administration off.
values Automatically executed functions (e.g. via time control, limit
value violation, etc.) are not executed.
Open help This function opens a selected help page from a CHM file.
Start Load Management This function starts the optimization for a selected service area
in the Load Management module. This function is only carried
out on the server.
More in chapter:: Start Load Management
Stop Load Management This function stops the optimization for a selected service area
in the EMS module. This function is only carried out on the
server.
Show license information A dialog to display the version and license information can be
called up with the help of this function.
Reload project online This function reloads only changed or all Runtime files.
Determine open This function sends currently open maintenances from the IMM
maintenances to status variables.
Switch on/off simulation This function switches between simulation mode and hardware
mode. The type of simulation mode or hardware mode can be
selected.
PFS - execute user-defined This function executes a PFS event previously created by a user.
event
More in chapter:PFS - execute user-defined event
Activate/deactivate Process This function activates or deactivates the playback mode of the
12 | 78
Functions
Function Description
Recorder playback Process Recorder module.
Simulate right click This function interprets the next mouse click as a right click.
Save remanent data Allows to the save the data of the configured modules.
The choices are: AML ring buffer, CEL ring buffer, system driver
and mathematics driver, internal driver, remanent images of all
drivers, locking of the command processing.
Analyze S7 Graph heuristics This function makes it possible to carry out the S7 Graph
heuristics without the screen S7 Graph being active.
Topology - Check Determines the supply state of the topological devices and
connections depicts them on variables.
3.2.5 Historian
This group contains functions for the optional module Historian.
13 | 78
Functions
Function Description
Archive: Stop This function stops a selected archive of the optional module
Historian.
Archive: Start This function starts a selected archive of the optional module
Historian.
Export archives This function exports filtered archive entries of the optional
module Historian to an external format.
Show open archives This function displays a list of running archives of the optional
module Historian.
Export Batch recipes Recipes can be exported to a XML file with the help of this
function.
Import Batch recipes Recipes can be imported from a XML file with the help of this
function.
Execute recipe You can send control commands to the batch execution with
command/change mode this function.
14 | 78
Functions
Function Description
Create control recipe With the help of this function, a pre-defined control recipe can
be created in the Editor by means of a button in the Runtime.
Login with dialog This function opens the standard login dialog.
Login without password This function logs in a selected user without asking for his
password.
More in chapter:Logout
Change password This function opens a dialog in which the currently logged-in
user can change their password.
3.2.8 Screens
This group contains functions for the handling of Screens.
Function Description
ALC source colors Function for the configuration of the ALC source colors for the
error detection in electric grids.
15 | 78
Functions
Function Description
Screen with index This function opens a screen with a name containing a selected
variable.
Screen: Return to last This function returns to the previously opened screen of the
selected frame.
Delete path for "Screen: With this function, the path of the Screen: Return to last
Return to last" function can be deleted in the Runtime.
Screen switch This function opens a selected screen. Optionally, a dialog for
the user can be opened before that.
Activate input to the This function executed the functionality of the element, which
element with the focus currently has the input focus.
Set focus to frame This function sets the input focus to the currently open screen of
a selected frame. This allows to create projects with pure
keyboard operation.
Move focus This function sets the input focus to a certain element on the
picture, whose frame currently has the focus.
Take focus away from This function takes the input focus aways from the currently
16 | 78
Functions
Function Description
frame open screen of a selected frame. This allows to create projects
with pure keyboard operation.
Show menu This function opens or closes a selected main menu. Optionally,
a dialog for the user can be opened before that.
Assign monitor This function assigns a selected virtual monitor to a selected real
monitor. Optionally, a dialog for the user can be opened before
that.
Runtime profiles Creates a function with which the profile administration can be
opened, a profile can be created or loaded in the Runtime
Move frame to foreground With this function, screens that are covered by other screens in
the Runtime can be moved to the foreground.
Close frame This function closes the currently open screen of a selected
frame.
Print screenshot This function prints out a screenshot of the whole monitor or
frames in the Runtime.
Setpoint input for This function sets a predefined value or writes a predefined
keyboard screen value in the keyboard screen type.
Display overview window This function opens an overview window. With this you can
simulate a multi-monitor system on a one-monitor system.
17 | 78
Functions
Acknowledge ground fault Function for acknowledging an earth fault message. Opens the
message dialog for selecting a variable.
Stop search for ground Function for closing the search for earth fault.
fault
More in chapter:Stop search for ground fault
Start search for ground Function for starting the search for earth fault.
fault
More in chapter:Start search for ground fault
Acknowledge ground fault Function for acknowledging a short-circuit message. Opens the
message dialog for selecting a variable.
Send Message: activate Activates Message Control in Runtime for the active
project.
Send Message: deactivate Deactivates Message Control in Runtime for the active
18 | 78
Functions
Function Description
project.
3.2.11 Network
This group contains functions for the handling of a Network.
Function Description
Redundancy switch This function swaps the project's Primary Server and the Standby
Server, depending on the selected Redundancy mode:
Evaluated
Dominant
Not dominant
19 | 78
Functions
Function Description
Report Generator: This function executes a selected report of the optional module Report
execute Generator.
Print Report This function prints a selected report of the optional module Report
Generator Generator.
Export Report This function exports a selected report of the optional module Report
Generator Generator to an external format.
Report Viewer: Makes it possible to issue reports in the Runtime as a PDF or online print.
export/print
More in chapter:Export or print report.
Attention
Reports that are displayed with the zenon Report Viewer are displayed
depending on the settings for the Windows font size.
This means: Reports are, in the event of changes to the size, not scaled using
the automatic screen adjustment of zenon. The content is not adjusted with
screen scalings.
20 | 78
Functions
REQUIREMENTS
In order for you to be able to create an event-triggered report for the zenon Analyzer via the zenon
Analyzer: Create report function, the following requirements must be met:
21 | 78
Functions
PROBLEM SOLUTION
Communication problems with the Analyzer server: Check the communication in the network as
well as the authentication (user and access rights).
Reports are rendered but do not contain any data: Check the license of the Analyzer server:
CREATING A FUNCTION
To create the function:
1. Create a new function in the zenon Editor.
2. Navigate to the Report Generator/Report Viewer/Analyzer group in the selection dialog.
22 | 78
Functions
6. Configure the report properties in the Parameter list (on page 27) tab.
When switching to the second tab, an attempt is made to set values that already exist for the
parameter input. If this is not successful, the list of set parameter values is displayed as empty.
Defaults can be replaced by individual values. To do this, deactivate the checkbox in front of the
value and click on the value. A dialog to enter the new value is opened
7. Link the function with a button or an event in order to be able to use it in Runtime
PROCEDURE IN RUNTIME
Procedure when triggering the function to create a report in Runtime:
1. The configured connection is established.
2. The selected report is set.
3. The selected parameter values are set for this report.
4. The report is created and output in the desired form.
5. The file name is generated and the file is saved in the export folder of the project.
6. The complete file name is written to the selected variable.
The options that are available in the Parameter list tab depend on your selection for the Report option.
23 | 78
Functions
ANALYZER SERVER
Option Description
24 | 78
Functions
Option Description
the password is hidden. The password is saved in
encrypted form and is only decrypted to establish a
connection.
REPORT CREATION
Option Description
25 | 78
Functions
Option Description
Include time stamp in file name Active: The execution time stamp is included in the
file name.
Variable for path to file created Shows the currently-selected zenon variable that gets the
path to the written report file.
26 | 78
Functions
CLOSE DIALOG
Option Description
OK Applies all changes in all tabs and closes the dialog.
Cancel Discards all changes in all tabs and closes the dialog.
Option Description
27 | 78
Functions
Option Description
Cannot be configured here.
CLOSE DIALOG
Option Description
OK Applies all changes in all tabs and closes the dialog.
Cancel Discards all changes in all tabs and closes the dialog.
28 | 78
Functions
The lot variables of a lot archive can be used here. For the lot report, carry out the Analyzer: Create
report function when closing the lot archive. The report then has the last lot of this archive as a time
filter.
Parameter Description
Default: 100
Whether a value can be configured can depend on whether the previous value has been selected. For
example, projects whose archives and variables can be configured must be selected.
The dialogs that are offered depend on the report selection:
29 | 78
Functions
EQUIPMENT GROUPS
Selection of desired equipment groups:
ARCHIVES
30 | 78
Functions
2. Click on Add.
the selected archives are added to the lower list.
3. If you want to remove archives again, highlight these in the lower list and click on Remove.
4. To transfer all selected archives groups to the report, click on OK.
COMPRESSION
COMPRESSION FUNCTION
PROJECTS
31 | 78
Functions
VARIABLES
Selection of the desired variables.
TIME PERIOD
32 | 78
Functions
a) To
2. Click on OK.
3.2.13 Recipes
This group contains functions for the handling of Standard Recipes and recipes of the optional module
Recipegroup Manager.
Function Description
Recipe Group This function writes, reads, copies, imports or exports a selected
Manager recipe of the optional module Recipegroup Manager (RGM).
Optionally, a dialog for the user can be opened before that.
Standard Recipe This function writes, reads, copies, imports or exports a selected
standard recipe. Optionally, a dialog for the user can be opened
before that.
Standard Recipe single This function sends the values of a selected standard recipe to the
directly PLC.
Standard Recipe single This function opens a dialog in which the user can edit or execute a
with dialog standard recipe.
Standard Recipe single This function opens a dialog in which the user can select and execute
with online dialog or edit a standard recipe.
33 | 78
Functions
Function Description
Teach command sequences Start or stop the teaching process in Runtime using
this button.
This function is particularly suitable for starting
teaching in Runtime in a process screen, without
having to switch to the command sequence editor.
Execute command sequences You can send control commands to the command
command/mode switching sequence execution with this function.
SQL export shift calendar These functions allow the creation and editing of
shift occurrences.
3.2.16 Script
This group contains functions for the handling of Scripts (on page 71).
Function Description
Script: select online This function opens a dialog in which the user can select and execute a
script.
34 | 78
Functions
Function Description
3.2.17 Variable
This group contains functions for the handling of Variables.
Function Description
Export data This function exports values of selected variables saved on the
hard disk (*.HDD) to an external format.
Read dBase file This function reads a selected dBase file and executes it as a
recipe.
Print current values This function prints current values of selected variables.
HD administration This function switches hard disk data storage off. HDD files are not
inactive written.
HD administration active This function switches hard disk data storage on. HDD files are
written.
HD administration This function switches hard disk data storage on or off. HDD files
inactive/active are (not) written.
Write/modify set value This function sends a new value for a selected variable to the PLC.
35 | 78
Functions
Function Description
Write time to variable This function reads the system time of the operating system and
writes it to a string variable in the PLC. This way, the system time of
the PLC can be synchronized with the operating system.
Read time from variable This function reads the time from a string variable of the PLC and
sets the system time of the operating system accordingly. This way,
the system time of the PLC can be synchronized with the
operating system.
3.2.18 VBA
This group contains functions for the handling of VBA (on page 6) macros.
Function Description
Open PCE editor This function opens the editor of the optional module Process
Control Engine (PCE).
Execute VBA m (on page This function executes a selected VBA macro.
6)acro
Attention: The VBA Event project inactive is carried out by
script AUTO_END_xxx. Therefore the zenon function Execute
VBA macro is no longer executed in scripts as VBA is not
running at this time. VBA macros which should be carried out in
"AUTOEND" must be called via Project.Inactive.
36 | 78
Functions
Function Description
Display VBA macro dialog This function opens the VBA macro dialog.
3.2.19 VSTA
This group contains functions for the handling of VSTA.
Function Description
Display VSTA macro dialog This function opens the VSTA macro dialog.
3.2.20 Windows
This group contains functions for the handling of operating system functionality.
Function Description
Play audio file This function plays a selected audio file (*.wav) once.
File operations This function copies, deletes or moves selected files. Optionally, a dialog
for the user can be opened before that.
Start continuous This function plays a selected audio file (*.wav) continuously.
tone
More in chapter:Start continuous tone (on page 49)
Stop continuous This function stops the continuous playing of a audio file (*.wav).
tone
More in chapter:Stop continuous tone (on page 49)
37 | 78
Functions
Function Description
Window to the This function switches the zenon Runtime to the background.
background
More in chapter:Window to the background (on page 49)
Start program This function starts an external program. Transfer parameters can be
defined. Optionally, a dialog for the user can be opened before that.
Parameter Description
Function new ... A new function is created and can be defined in the
properties window.
Show unused functions... Opens the Project analysis in the main window and shows
38 | 78
Functions
Parameter Description
unused functions.
Export all as XML Export all functions to an XML file See chapter Import/Export.
Import XML ... Import functions from an XML file. See chapter Import/Export.
Open in new window... Opens the detailview of the functions in a new window.
A function is created after you have selected it and confirmed with OK. The parameters of this new
function can now be defined in the properties window.
39 | 78
Functions
If you press the Help button in the Dialog after the selection, you will be forwarded directly to the
corresponding function in the online help.
Similar to the properties window also here an individually definable favourite view is available. The node
Favorites is always at the top of the list. As a default it contains the functions Screen switch and
Write/modify set value. Any function can be added to or removed from the favourites with the
context menu or by Drag&Drop.
If a function is selected, you will find a dialog help in the lower part of the dialog. You will find more
information on the single functions in the chapter Overview functions (on page 8).
This is possible for screens (Screen Start-end Function, Buttons), limit values, time control, scheduler,
scripts, menus, projects (automatic function execution, archive).
Parameter Description
Select printer This function opens a dialog in which the user can
select printers for the different print tasks.
Note: This function is not available for CE devices.
Print Extended Trend diagram With the help of this function you can print
40 | 78
Functions
Parameter Description
diagrams of the extended trend or save them in a
file (JPG or BMP) without opening the screen
Extended Trend.
Functions active at limit values This function activates the function administration.
Automatically executed functions (e.g. via time
control, limit value violation, etc.) are executed.
Functions active/inactive at limit values This function switches the function administration
on or off. Automatically executed functions (e.g. via
time control, limit value violation, etc.) are (not)
executed.
Functions inactive at limit values This function switches the function administration
off. Automatically executed functions (e.g. via time
control, limit value violation, etc.) are not executed.
Reload project online This function reloads amended Runtime files in the
Editor.
Simulate right click This function interprets the next mouse click as a
right click.
Save remanent data Allows to the save the data of the configured
modules. The choices are: AML ring buffer, CEL
ring buffer, system driver and mathematics driver,
internal driver, remanent images of all drivers and
locking of the Command Processing.
Execute SAP function Carries out an SAP function defined in the SAP
interface in the Runtime. The SAP function in turn
triggers a remote function call (RFC) in the SAP
system.
41 | 78
Functions
This function is used to change the printer selection during online operation. This function needs no
parameters.
The settings of the printers are done as described in the chapter Configuration/Standard/Printer.
[FUNKTIONEN]
3.4.1.5 Reload
The reloading is only carried out in this case if these elements are closed again.This function loads
changed Runtime files without having to restart Runtime.
42 | 78
Functions
Information
Changes which have an affect on the complete zenon Runtime, require the
zenon Runtime to be restarted.
The reloading is only carried out in this case if these elements are closed again.
Attention
PNG graphics files cannot be overwritten if they are currently being displayed in
Runtime.
Background: The Runtime protects opened .png files. This prevents these being
overwritten.
This also applies for the reloading of amended Runtime files. The Runtime sync
in the network does not work for a *.png screen if this is switched on a zenon
computer that is involved in the process (standby server, client).
43 | 78
Functions
Attention
The VBA Event project inactive is carried out by script AUTO_END_xxx.
Therefore the zenon function Execute VBA macro is no longer executed in
scripts as VBA is not running at this time. VBA macros that should be carried
out in "AUTO_END" must be called up via Project.Inactive.
Cyclical archives must not be given in the AUTOEND script.
44 | 78
Functions
Module Description
System driver and Active: Data of the system driver and of the mathematics driver
mathematics driver are saved.
If errors occur during the saving process, they are written to the error protocol.
Information
If the Runtime runs in simulation mode (project simulation active), function Save
remanent datadoes not save values from the following drivers:
Internal driver
Mathematics driver
System driver
Play audio file This function plays a selected audio file (*.wav)
once.
Start continuous tone This function plays a selected audio file (*.wav)
continuously.
45 | 78
Functions
Parameters Description
audio file (*.wav).
Window to the background This function switches the Runtime of the control
system to the background.
46 | 78
Functions
Note: Copying and moving of several files with the same renaming of the file extension is not possible.
Copy copies files from one name and path to a new name and path. Transfer
parameters are considered.
Move Moves files from one name and path to a new name and path and deletes
them in source path. Transfer parameters are considered.
Attention: Files are not saved in the Windows Recycle Bin, but are deleted
directly and permanently.
If the given source cannot be found (file or path is not present or incorrect), the function will not be
executed. By default, no error message is generated. You can also force an error message via the
options; we do not recommend this, as this might block the runtime or the processing of other
functions.
Source/Target Enter the path to source and target. You can also use wild cards
(*) for source and target. (Wildcards are only allowed as prefix or
suffix; e.g. *xxx or xxx*.)
47 | 78
Functions
Parameter Description
There are three ways of defining a path:
absolute (You can also use the button '...' next to the text
field).
relative according to runtime folder (Link: more about the
runtime folder)
relative according to the data folder. (Link: more about the
data folder).
For example:
absolute:
Source 'C:\temp\datenbank.mdb' to target 'D:\backup\' -> The
file 'database.mdb'is copied to the directory 'D:\backup\'. In
order for the copying to work, the target directory must already
exist and it must be followed by a backslash.
relative:
relative according to the data directory: '*.aml' to
target 'D:\backup\' copies all files of the alarm list to the folder
'D:\backup\'.
Rename files:
It is possible to rename single files. For example:
'C:\temp\datenbank.mdb' to target 'D:\backup\backupdb.mdb'
copies the file 'datenbank.mdb' to the directory 'D:\backup\' and
renames it to 'backupdb.mdb'.
Consider subfolders Looks for files also in the sub folder of the source path and
creates that tree structure in the target directory.
Overwrite existing files If the source file already exists in the destination directory, it will
be overwritten by the new file.
Display error messages If copying or moving file is not possible, an error message is
displayed as system message We do not recommend to activate
this option, as it may block the runtime or the processing of other
functions.
48 | 78
Functions
Parameter Description
Show this dialog in the Before the function is executed in online operation, a dialog box
Runtime is loaded, which allows to adjust parameters (file operation,
source, target etc.). The modified settings remain during the
runtime of the online operation. In this dialog box, the option
dialog box before execution is missing.
Only execute if file(s) File operation is executed only when time criterion was defined
(days, hours).
older than The file must be older than the entered time. '1 day' always
means 24 hours after execution time.
newer than The file must be more up to date than the entered time. ‘1 day'
always means 24 hours after execution time.
Note: 'older than' must be greater than 'younger than'.
...
49 | 78
Functions
[DEFAULT]
Information
When switching Runtime to the foreground with the Window to foreground
function, the Runtime window is defined as the upper window.
You have the following options to get the alarm status line back to the
foreground:
Activate the symbol keys (deactivate Lock system keys project property)
and get the alarm status line back to the foreground with Alt+Tab.
Activate the Windows task bar and click on the Status window.
Move Runtime to the background again.
Restart the Runtime.
50 | 78
Functions
Give the program file (*.EXE) as the transfer parameter. This function is configured via an input dialog.
Name name of file which will be executed; search and select via button is
possible
Show this dialog in changes program and parameter during online operation when
the Runtime function is called
For the start of a program it has to be in a search path (system environment under Windows NT).
User-defined programs (Visual Basic) should be stored in the installation path of zenon.
When the Alarm Message List is active and an alarm in the list has been selected, the call of the
variables' name can be transferred as a parameter (for external database information systems). The
parameter is transferred as a key word.
Parameter Description
51 | 78
Functions
If no Alarm Message List is open, or several or no alarms are selected, no transfer parameters are
generated. If several Alarm Message Lists are displayed (global or selective list), the selected entry of the
first found list is used.
If the Chronological Event list is active and an entry in the list has been selected, the program call of the
variable's name can be transferred as a parameter (for external database information systems). The
parameter is transferred as a key word.
Parameter Description
If no Chronologic Event List is open, or several or no entries are selected, no transfer parameters are
generated. If several Chronologic Event Lists are open (global or selective list), the selected entry of the
first found list is used.
This function is used to to consider the effects of the started program on the system as a whole
(required resources, multitasking, program stability, etc.).
52 | 78
Functions
Information
Scripts combine several functions. The place of execution then depends on the
settings of the Execute script function. This setting overwrites the settings of the
individual functions.
Key:
Adjustable: Behavior can be configured
+: Yes
-: No
O: Default
If not adjustable, O identifies the place of execution:
Active computer
Primary Server
Standby Server
Client
53 | 78
Functions
Delete alarms - O O
Acknowledge alarms - O O
Activate/deactivate Alarm - O O
Message List, alarm/event
groups/classes
Export AML + O
Export CEL + O
Select printer + O
Switch palette + O
54 | 78
Functions
Open help + O
Activate/deactivate project - O
simulation
Exit Runtime + O
Language switch + O
Archive: Stop - O O
Index archive - O
Archive: Start - O O
Export archives - O
55 | 78
Functions
Change user + O
Logout + O
Change password - O
Screens
Close screen + O
Screen switch + O
Move focus - O
Show menu + O
Assign monitor + O
Runtime profiles + O
Close frame + O
56 | 78
Functions
Acknowledge short-circuit + O
message
Message Control
Group/class/area/equipment - O
suppressed
Send a Message - O
Redundancy switch - O
Report Generator
Standard Recipe - O
57 | 78
Functions
Script: execute + O
Export data - O
HD administration active - O O
HD administration inactive - O O
HD administration inactive/active - O O
Driver commands - O
58 | 78
Functions
File operations + O
Window to foreground - O
Print screenshot + O
Start program + O
If, for a function with priority 1, a dialog is displayed before the function is carried out, the priority is
downgraded to 2.
Within one project all functions of one script (on page 65) are in the same queue. All functions in a
priority level are executed in the script. This guarantees that the functions are executed after one
another.
59 | 78
Functions
Example
A script is used to activate a screen arrangement with screens of different
projects using the Screen Switch function, which depends on the sequence of
execution (screens are above other screens).
Acknowledge alarms 1
Export CEL 2
Select printer 3
60 | 78
Functions
Switch palette 2
Open help 3
Language switch 2
Archive: Stop 1
Index archive 1
Archive: Start 1
Archive: List of active archives 2
Export archives 1
Change user 3
Logout 2
Change password 2
61 | 78
Functions
Close screen 2
Screen switch 1
Move focus 1
Show menu 1
Assign monitor 1
Runtime profiles 1
Close frame 1
Group/class/area/equipment suppressed 1
Send a Message 1
62 | 78
Functions
Redundancy switch 1
Standard Recipe 2
Script: execute 1
Export data 3
HD administration active 1
HD administration inactive 1
HD administration inactive/active 1
63 | 78
Functions
Driver commands 2
File operations 3
Window to foreground 2
Print screenshot 2
Start program 2
64 | 78
Scripts
4 Scripts
Scripts compile several functions together in order to execute these in a sequence in the Runtime. zenon
also provides some pre-defined scripts (on page 68).
Editor profile Opens the drop-down list with predefined editor profiles.
Symbol Description
Add functions Opens the dialog for adding functions (on page 67).
Use of scripts Opens the Project analysis in the main window and displays
the elements with which the selected script is used.
Show unused scripts Opens the Project analysis in the main window and shows
unused scripts.
65 | 78
Scripts
Symbol Description
Edit selected cell Renames the script. Also possible by clicking in the field with
the mouse or by pressing the F2 key.
Add functions Opens the dialog for adding functions (on page 67).
Create standard function Automatically creates a standard function for the selected
script.
Use of scripts Opens the Project analysis in the main window and displays
the elements with which the selected script is used.
Show unused scripts Opens the Project analysis in the main window and shows
unused scripts.
66 | 78
Scripts
Parameter Description
Edit selected cell Renames the script. Also possible by clicking in the field with
the mouse or by pressing the F2 key.
Information
When you change the script name, the parameters of the linked functions are
changed accordingly. With multi-user projects, functions are changed
automatically after requesting confirmation (Allow changes). After the name has
been changed successfully, the script is changed.
CONFIGURING A SCRIPT
To configure a new script:
1. Select New symbol in the context menu or in the toolbar.
2. A new script is added to the list.
3. Issue a name or select a pre-defined script (on page 68) from the drop-down list.
Note: The name must not be empty.
4. Add functions and sort them.
Functions are executed in the sequence of the project configuration.
67 | 78
Scripts
5. Create a function to start (on page 71) the script in the Runtime.
FUNCTION NEW
AUTOSTART The start information (e.g. open headings and status lines, reset alarm
outputs etc.) is configured in the script.
68 | 78
Scripts
Script Description
project or if it is a sub project in a multi-hierarchical network.
Attention:
The Execute VBA macro and Execute VSTA macro functions
are not executed in AUTOEND scripts, because the API
interface was already terminated at this point in time.
Use the Project.Inactive event in the API to execute the
corresponding functionality before ending Runtime.
Cyclical archives must not be included in the AUTOEND script.
AUTOSTART_CLIENT The start information (e.g. open headings and status lines, reset alarm
outputs etc.) is configured in the script. The script will be executed
automatically at the start of Runtime on the client after activation of
the start display on the client if the project is the Runtime start project.
Attention:
The Execute VBA macro and Execute VSTA macro functions
are not executed in AUTOEND scripts, because the API
interface was already terminated at this point in time.
Use the Project.Inactive event in the API to execute the
corresponding functionality before ending Runtime.
69 | 78
Scripts
Script Description
on the computer that is the server for the project, after opening the
start screen, regardless of whether the project has been defined as
the start project or whether it is a sub project in a multi-hierarchical
network.
Attention:
The Execute VBA macro and Execute VSTA macro functions
are not executed in AUTOEND scripts, because the API
interface was already terminated at this point in time.
Use the Project.Inactive event in the API to execute the
corresponding functionality before ending Runtime.
Cyclical archives must not be included in the AUTOEND script.
The following scripts are available for the HTML Web Engine; they are executed automatically:
Script Description
AUTOSTART_HTML_W This script is executed whenever a session of an HTML web client starts.
EBCLIENT
The following scripts are available for simulation mode; they are executed automatically:
Script Description
AUTOSTART_SIMUL If Runtime is started in simulation mode, the script with the name
AUTOSTART_SIMUL is executed automatically if it is available.
Note: Also applies for playback mode of the Process Recorder module.
AUTOEND_SIMUL If Runtime is ended in simulation mode, the script with the name
AUTOEND_SIMUL is executed automatically if it is available.
Note: Also applies for playback mode of the Process Recorder module.
70 | 78
Scripts
71 | 78
Scripts
Parameter Description
List of projects (left) Selection of the project from which the script is to be selected.
List of scripts (right) Selection of the script. Only one script can be linked.
Scripts can be created and edited using the toolbar and context
menu. New scripts and changes are saved immediately.
Symbol/Command Description
Add functions Opens the dialog for adding functions (on page 67).
72 | 78
Scripts
Symbol/Command Description
Edit selected cell (only toolbar) Renames the script. Also possible by clicking in the field with
the mouse or by pressing the F2 key.
Replace text in selected Opens the dialog to search and replace texts in the
column (only toolbar) currently-selected column.
Information
Take care of the priorities of the script execution in the network (on page 73)
Scripts can be called up using the Script: execute or Script: select online functions.
The configuration of the Execution script property overwrites the configuration of the Execution
function property contained in the script.
Function which had a different execution location assigned, take over the execution location defined
here.
73 | 78
Select Functions and scripts dialog
Consequence: Both functions are carried out on the same computer; the computer on which
the Script: execute function is executed. This can be a client, a server or a standby, depending
on the network role of the calling computer.
Driver commands are executed on the Server and the Standby per default. If a script with driver
commands is started on the Client, then:
the function driver command is started on the Client
the driver is stopped after the execution of the script on the Server
The dialog offers the possibility to select functions and to configure scripts:
Functions selection (on page 75): Selection of a function or creation of a new function
74 | 78
Select Functions and scripts dialog
Script selection (on page 76): Selection of a script or creation of a new script as well as
assignment of a function Script: execute
To select a function:
1. Select the project that contains the function.
Note: If a different project than the current one is selected, ensure that the project is available
in the Runtime.
2. Select the desired function.
If necessary, it is possible to use the toolbar or context menu to create new functions or copy
existing functions.
3. Confirm the selection by clicking OK.
Parameter Description
List of projects (left) Selection of the project from which the function is to be
selected.
75 | 78
Select Functions and scripts dialog
Parameter Description
List of functions (right) Selection of the function. Only one function can be
linked. If more than one function is selected, then the
function that was selected last was linked.
To select a script:
1. Select the project that contains the script.
Note: If a different project than the current one is selected, ensure that the project is available
in the Runtime.
2. Select the desired script.
76 | 78
Select Functions and scripts dialog
Parameter Description
List of projects (left) Selection of the project from which the script is to be
selected.
List of scripts (right) Selection of the script. Only one script can be linked.
Function: Script: execute Selection of the function that is to execute the selected
77 | 78
Select Functions and scripts dialog
Parameter Description
script from a combo box.
Symbol/Command Description
Add functions Opens the dialog for adding functions (on page 67).
Edit selected cell (only toolbar) Renames the script. Also possible by clicking in the field with
the mouse or by pressing the F2 key.
Replace text in selected Opens the dialog to search and replace texts in the
column (only toolbar) currently-selected column.
78 | 78