Functions_and_scripts
Functions_and_scripts
v.7.50
©2016 Ing. Punzenberger COPA-DATA GmbH
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.
Table of contents
3. Functions .................................................................................................................................... 6
3.1 Detail view of context menus and toolbar .................................................................................................. 7
3.2 Overview functions in zenon ....................................................................................................................... 8
3.2.1 Favorites ....................................................................................................................................... 9
3.2.2 AML and CEL ................................................................................................................................. 9
3.2.3 Application ................................................................................................................................. 12
3.2.4 Historian ..................................................................................................................................... 14
3.2.5 Batch Control .............................................................................................................................. 15
3.2.6 User Administration ................................................................................................................... 16
3.2.7 Screens ....................................................................................................................................... 17
3.2.8 Fault locating in electric grids ..................................................................................................... 19
3.2.9 Message Control ......................................................................................................................... 19
3.2.10 Network ...................................................................................................................................... 20
3.2.11 Report Generator / Report Viewer / Analyzer ........................................................................... 20
3.2.12 Recipes ....................................................................................................................................... 35
3.2.13 Command Sequencer ................................................................................................................. 35
3.2.14 Script........................................................................................................................................... 36
3.2.15 Variable ...................................................................................................................................... 37
3.2.16 VBA ............................................................................................................................................. 38
3.2.17 VSTA ........................................................................................................................................... 38
3.2.18 Windows ..................................................................................................................................... 39
3.3 Engineering in the Editor .......................................................................................................................... 39
3.3.1 Creating and editing functions ................................................................................................... 40
3.3.2 Selecting a function .................................................................................................................... 41
3.3.3 Deleting functions ...................................................................................................................... 41
3.3.4 Inserting functions from other projects ..................................................................................... 42
3.4 System functions ....................................................................................................................................... 42
3.4.1 Application - functions ............................................................................................................... 42
3.4.2 Windows - Functions .................................................................................................................. 47
3
3.5 Functions in the network .......................................................................................................................... 53
3.6 Execution sequence during Runtime ........................................................................................................ 60
4. Scripts ....................................................................................................................................... 65
4.1 Context menu and toolbar for scripts ....................................................................................................... 66
4.2 Engineering in the Editor .......................................................................................................................... 68
4.3 Pre-defined scripts .................................................................................................................................... 70
4.4 Executing scripts in Runtime ..................................................................................................................... 73
4.5 Priorities in the network ........................................................................................................................... 76
4
Welcome to COPA-DATA help
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]
(mailto:[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] (mailto:[email protected]).
If you find that you need other modules or licenses, our staff will be happy to help you. Email
[email protected] (mailto:[email protected]).
5
Functions and scripts
License information
Part of the standard license of the Editor and 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.
6
Functions
PROJECT MANAGER
Display unused functions Creates a project analysis for unused functions in the current project
and displays it as result list in an own window.
DETAIL VIEW
7
Functions
8
Functions
3.2.1 Favorites
This group contains functions for the handling of the alarm message list (AML) and the Chronological
Event List (CEL).
9
Functions
Function Description
Alarms: acknowledge flashing This function acknowledges the flashing of all elements of the
currently open screen of a selected frame.
More in chapter: Alarms: acknowledge flashing
Delete alarms This function deletes filtered alarms.
More in chapter: Alarms: delete
Alarm/event group log in/log off This function switches on/off the connection to the PLC for a selected
alarm/event group.
More in chapter: Alarm/event group log in/log off
Alarm Message List active This function activates the entire alarm message list.
More in chapter: Alarm Message List active
Alarm Message List active/inactive This function activates/deactivates the entire alarm message list.
More in chapter: Alarm Message List active/inactive
Alarm Message List inactive This function deactivates the entire alarm message list.
More in chapter: Alarm Message List inactive
Activate/deactivate Alarm Message This function activates/deactivates an alarm/event group, an
List, alarm/event groups/classes alarm/event class or the entire Alarm Message List.
More in chapter: Activate/deactivate alarm message list /
alarm/event groups / alarm/event classes
Export AML This function exports filtered entries of the alarm message list to an
external format.
More in chapter: Export AML
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.
More in chapter: Save AML and CEL memory buffer
Export CEL This function exports filtered entries of the Chronologic Event List
(CEL) to an external format.
More in chapter: Export CEL
Print AML or CEL This function prints selected entries of the alarm list (AML) or the
Chronological Event List (CEL).
More in chapter: Print AML or CEL
Create/print IPA document This function creates an IPA report and writes it to an HTML file or
prints it out.
10
Functions
Switch online printing on/off This function switches on/off online printing of the alarm message
list or the Chronological Event List (CEL).
More in chapter: Switch online-printing on/off
Online printing start new page In activated online printing this function finishes a page and starts a
new one. The page number is reset to 1.
More in chapter: Online printing start new page
Switch online printer This function switches the online printing to a selected printer.
Optionally, a dialog for the user can be opened before that.
More in chapter: Switch online printer
11
Functions
3.2.3 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.
More in chapter: Select printer (on page 44)
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.
More in chapter: Stop Load Management
Print Extended Trend diagram With the help of this function you can print diagrams of the extended
trend or save them in a file (JPG or BMP) without opening the screen
Extended Trend.
More in chapter: Print Extended Trend diagram
Switch palette Creates a function in order to switch between palettes in the Runtime.
More in chapter: Switch palette
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.
More in chapter: Functions active at limit value (on page 44)
Functions active/inactive at This function switches the function administration on or off.
limit values Automatically executed functions (e.g. via time control, limit value
violation, etc.) are not executed.
More in chapter: Functions active/inactive at limit value (on page 44)
Functions inactive at limit This function switches the function administration off. Automatically
values executed functions (e.g. via time control, limit value violation, etc.) are
not executed.
More in chapter: Functions inactive at limit value (on page 44)
Open help This function opens a selected help page from a CHM file.
More in chapter: Open help
Reload project online This function reloads only changed or all Runtime files.
More in chapter: Reload project online (on page 44)
12
Functions
Determine open maintenances This function sends currently open maintenances from the IMM to
status variables.
More in chapter: Determine open maintenances
Switch on/off simulation This function switches between simulation mode and hardware mode.
The type of simulation mode or hardware mode can be selected.
More in chapter: Activate/deactivate project simulation
PFS - execute user-defined This function executes a PFS event previously created by a user.
event
More in chapter: PFS - execute user-defined event
Simulate right click This function interprets the next mouse click as a right click.
More in chapter: Simulate right click (on page 45)
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.
More in chapter: Save remanent data (on page 46)
Exit Runtime This function closes the zenon Runtime.
More in chapter: Exit Runtime (on page 45)
S7 Graph heuristics This function makes it possible to carry out the S7 Graph heuristics
without the screen S7 Graph being active.
More in chapter: S7 Graph heuristics
Execute SAP function Enables call up of a SAP function in the Runtime.
More in chapter: Execute SAP function
Language switch This function switches to a selected language in multi-lingual projects.
More in chapter: Language switch
Topology - Search for ground Call up of the short circuit detection.
fault
More in chapter: Topology - Search for ground fault
Topology - Check connections Determines the supply state of the topological devices and depicts them
on variables.
More in chapter: Topology - LoadShedding
13
Functions
3.2.4 Historian
This group contains functions for the optional module Historian.
Function Description
Archive: Stop This function stops a selected archive of the optional module Historian.
More in chapter: Archive: Stop
Index archive This function indexes archives.
More in chapter: Index archive
Archive: Start This function starts a selected archive of the optional module Historian.
More in chapter: Archive: Start
Export archives This function exports filtered archive entries of the optional module
Historian to an external format.
More in chapter: Export archives
Display open archives This function displays a list of running archives of the optional module
Historian.
More in chapter: Display open archives
14
Functions
Function Description
Export Batch recipes Recipes can be exported to a XML file with the help of this
function.
15
Functions
Function Description
Change user This function opens a dialog, where a logged-in administrator can
create, edit or delete users and user groups.
More in chapter: Change user
Login with dialog This function opens the standard login dialog.
More in chapter: Login with dialog
Login without password This function logs in a selected user without asking for his password.
More in chapter: Login without password
Logout This function logs out the currently logged in user.
More in chapter: Logout
Change password This function opens a dialog in which the currently logged-in user can
change their password.
More in chapter: Change password
16
Functions
3.2.7 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.
More in chapter: ALC source colors
Screen with index This function opens a screen with a name containing a selected variable.
More in chapter: Screen with index
Close screen This function closes a selected screen.
More in chapter: Close screen
Screen: Return to last This function returns to the previously opened screen of the selected
frame.
More in chapter: Screen: Return to last
Delete path for "Screen: Return with this function, the path of the Screen: Return to last function can
to last" be deleted in Runtime.
More in chapter: Delete path for "Screen: Return to last"
Screen: Move center This function scrolls or zooms in a worldview screen.
More in chapter: Screen: Move center
Screen switch This function opens a selected screen. Optionally, a dialog for the user
can be opened before that.
Note: Without dialog the function is carried out with the highest priority
(1). If a dialog is called up before the execution, the priority is
downgraded to high (2).
More in chapter: Screen switch
Activate input to the element This function executed the functionality of the element, which currently
with the focus has the input focus.
More in chapter: Activate input to the element with the 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.
More in chapter: Set focus to frame
Move focus This function sets the input focus to a certain element on the picture,
whose frame currently has the focus.
More in chapter: Move focus
Take focus away from frame This function takes the input focus aways from the currently open
screen of a selected frame. This allows to create projects with pure
keyboard operation.
17
Functions
18
Functions
Function Description
Acknowledge ground fault Function for acknowledging an earth fault message. Opens the dialog for
message selecting a variable.
More in chapter: Acknowledge ground fault message
Stop search for ground fault Function for closing the search for earth fault.
More in chapter: Stop search for ground fault
Start search for ground fault Function for starting the search for earth fault.
More in chapter: Start search for ground fault
Acknowledge ground fault Function for acknowledging a short-circuit message. Opens the dialog for
message selecting a variable.
More in chapter: Acknowledge short-circuit message
Function Description
Save current queue In the Runtime saves the current message queue.
More in chapter: Save current queue
Group/class/area/equipment Makes it possible to suppress the sending of messages for certain
suppressed alarms.
More in chapter: Suppress groups/classes/areas/equipment:
Send a Message Creates a function for sending messages.
More in chapter: Send a Message
Send Message: activate Activates Message Control in the Runtime for the activated
project.
More in chapter: Send Message: activate
Send Message: deactivate Deactivates Message Control in the Runtime for the activated
project.
More in chapter: Send Message: deactivate
19
Functions
3.2.10 Network
This group contains functions for the handling of a Network.
Function Description
Authorization in the This function fetches or releases the authorization in a network.
network
More in chapter: Authorization in network
Redundancy switch This function exchanges the Primary Server and the Standby Server of the
project.
The configuration dialog is slightly different, depending on the selected
Redundancy mode:
Rated
Not dominant
Note: With Redundancy mode not dominant, no additional configuration is
necessary.
Note: Not available if the CE terminal serves as a data server. You can find
further information in the zenon Operator manual in the CE terminal as a
data server chapter.
More in chapter: Redundancy switch
20
Functions
Function Description
Analyzer: Create Event-controlled report creation makes it possible to use an event as a
Report
trigger for the creation and dispatch of a report in the COPA-DATA product
zenon Analyzer; a value change for example.
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.
zenon Analyzer
zenon provides functions that make the exchange of data with the COPA-DATA product zenon Analyzer
more easy.
21
Functions
Event-triggered report creation makes it possible to use an event - such as a change of value, for
instance - as a trigger for the creation and sending of a report. These reports can be created by means of
a zenon function (on page 22).
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:
22
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
23
Functions
6. Configure the report parameters in the Parameter list (on page 28) 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.
Default values 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. Connect the function with a button or an event in order to be able to access it in Runtime
PROCEDURE IN RUNTIME
General settings
In this tab, the connection to the Analyzer server is configured and selected in the report. This tab must
be configured before the switch to parameter list.
24
Functions
25
Functions
ANALYZER SERVER
Parameters Description
Analyzer Server Configuration of the connection to the Analyzer server.
Version Select the version of the Analyzer server from the drop-down
list. Only available if there is no connection.
Computer name Entry of the name of the computer on which the Analyzer server
runs. Only available if there is no connection.
Use Windows authentication Selection of the type of authentication:
Active: Windows authentication is used.
Inactive: The user must enter the user name and
password.
User name Entry of the user name.
Only available if Use Windows authentication is inactive
and there is no connection.
Password Entry of the password for authentication.
The characters entered are not shown and the length of the
password is hidden. The password is saved in encrypted form
and is only decrypted to establish a connection.
Only available if Use Windows authentication is inactive
and there is no connection.
Secure connection Active: The connection is established as secure.
Only available for zenon Analyzer from version 3.00.
Extended Advanced settings for the connection waiting time. This can be a
maximum of 1 day.
Clicking on the button opens the dialog for configuration. (on
page 30)
Only available for zenon Analyzer from version 3.00.
Establish connection Clicking on the button establishes a connection to the analyzer
server.
Once the connection has been successfully established, the
drop-down lists for report and format are updated.
Close connection Clicking on the button disconnects the existing connection.
REPORT CREATION
Parameters Description
Report creation Configuration of the basis data for the report.
26
Functions
Variable for path to file created Shows the currently-selected zenon variable that contains the
path to the written report file.
Click on button ... in order to open the dialog for selecting a
variable.
Hint: Thus when a lot archive is closed or if a limit value is
breached, a script can send an event-triggered report by E-mail
from zenon. In doing so, this variable is used to define the
attachment of the Message Control function Send a Message.
Procedure:
Firstly, the report function that writes the variable is
executed.
Then the Send a Message function is executed, which reads
the attachment path from the variables.
CLOSE DIALOG
27
Functions
Parameters Description
OK Applies all changes in all tabs and closes the dialog.
Cancel Discards all changes in all tabs and closes the dialog.
Help Opens online help.
Parameter List
You configure the report parameters in this tab. The controls that are offered depend on the selection of
the report in the General settings tab.
28
Functions
Parameters Description
Parameter List Display of the report parameters. The sequence
corresponds to the sequence in the report.
Recommendation: Configure the parameters from top to
bottom.
Parameter Name Display of the parameter name.
Cannot be configured here.
Standard Defines whether the parameter is set to its default value.
Active: The default value from the report is used.
Inactive: The value is selected individually by clicking in
the Value column.
Clicking with the mouse or pressing the empty button with the
parameter highlighted switches the checkbox. If a parameter has
a default value, the checkbox is grayed out and inactive.
Value Display of the current value of the parameter.
If the Standard checkbox is activated, the text default
value is displayed here and the cell does not allow any
input.
If the Standard checkbox is deactivated, the
currently-configured value is shown here.
Clicking on the cell or pressing the Enter key with the
parameter highlighted opens the input dialog (on page 30)
for the respective value.
If a parameter cannot be entered, the text not available is
displayed and the cell is deactivated. This can mean, for
example, that values for a different parameter must be set first
in order to fill the list of values.
CLOSE DIALOG
Parameters Description
OK Applies all changes in all tabs and closes the dialog.
Cancel Discards all changes in all tabs and closes the dialog.
Help Opens online help.
Tip for lot/shift reports
In Runtime, the value of a zenon string variable is read. A search for this string as a label is carried out in
the list of predefined values for the parameter. The value of the label to be corresponded to is then the
parameter value, i.e. the selected shift or lot.
29
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.
Configuration of the connection waiting time. The dialog is opened by clicking on the Advanced button
in the General Settings (on page 24) tab.
Parameters Description
Connection timeout Waiting time for establishing a connection in seconds. The establishment
of the connection is canceled if this is exceeded.
Minimum: 1
Maximum: 86400 (1 day)
Default: 100
OK Applies settings and closes the dialog.
Cancel Discards all changes and closes the dialog.
For the configuration of the parameter values, there are appropriate dialogs available for each input.
The configuration is carried out depending on the input possibility for:
A value without a predefined value: Entry of the value.
Several values without predefined values: Entry of the values and adding to a list.
A value with predefined value: Selection from drop-down list or list.
Several values with pre-defined values: Select from list.
30
Functions
EQUIPMENT GROUPS
ARCHIVES
31
Functions
COMPRESSION
MAXIMUM VALUE
Minimum value
32
Functions
PROJECTS
33
Functions
VARIABLES
TIME SPAN
34
Functions
3.2.12 Recipes
This group contains functions for the handling of Standard Recipes and recipes of the optional module Recipegroup
Manager.
Function Description
Recipe Group Manager This function writes, reads, copies, imports or exports a selected recipe of the
optional module Recipegroup Manager (RGM). Optionally, a dialog for the
user can be opened before that.
More in chapter: Recipegroup Manager
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.
More in chapter: Standard recipe
Standard Recipe single This function sends the values of a selected standard recipe to the PLC.
directly
More in chapter: Standard Recipe single directly
Standard Recipe single This function opens a dialog, where the user can change and execute a
with dialog standard recipe.
More in chapter: Standard Recipe single with dialog
Standard Recipe single This function opens a dialog, where the user can select and execute or edit a
with online dialog standard recipe.
More in chapter: Standard Recipe single with online dialog
35
Functions
Function Description
Export command sequences Exports configured command sequences as an XML file.
More in chapter: Export command sequences.
Import command sequences Imports configured command sequences from an XML
file.
More in chapter: Import command sequences.
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.
More in chapter: Teach command sequences
Execute command sequences command/mode You can send control commands to the command
switching sequence execution with this function.
More in chapter: Execute command sequence or mode
change
3.2.14 Script
This group contains functions for the handling of Scripts (on page 73).
Function Description
36
Functions
3.2.15 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.
More in chapter: Export data
Read dBase file This function reads a selected dBase file and executes it as a recipe.
More in chapter: Read dBase file
Print current values This function prints current values of selected variables.
More in chapter: Print current values
Measuring unit conversion Switches from basic unit to conversion unit.
More in chapter: Unit conversion
HD administration inactive This function switches hard disk data storage off. HDD files are not written.
More in chapter: HD administration inactive
HD administration active This function switches hard disk data storage on. HDD files are written.
More in chapter: HD administration active
HD administration This function switches hard disk data storage on or off. HDD files are (not)
inactive/active written.
More in chapter: HD administration inactive/active
Write set value This function sends a new value for a selected variable to the PLC.
More in chapter: Write set value
Driver Commands This function sends a selected command to a selected driver. Optionally, a
dialog for the user can be opened before that.
More in chapter: Driver Commands
Transfer driver simulation Is only carried out at the Standby Standby Server.
image to the Standby Server
Demands an image for the selected drivers from the server when it is
executed. The driver has 5 seconds of time for this.
More in chapter: Transfer driver simulation image to the standby
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.
More in chapter: Write time to variable
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.
More in chapter: Read time from variable
37
Functions
3.2.16 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).
More in chapter: Open PCE editor
Open VBA editor This function opens the VBA editor.
More in chapter: Open VBA Editor
Execute VBA m (on page 6)acro This function executes a selected VBA macro.
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.
More in chapter: Execute VBA macro
Show VBA macro dialog This function opens the VBA macro dialog.
More in chapter: Show VBA macro dialog
3.2.17 VSTA
This group contains functions for the handling of VSTA.
Function Description
Open VSTA editor This function opens the VSTA editor.
More in chapter: Open VSTA Editor
Execute VSTA macro This function executes a selected VSTA macro.
More in chapter: Execute VSTA macro
Show VSTA macro dialog This function opens the VSTA macro dialog.
More in chapter: Show VSTA macro dialog
38
Functions
3.2.18 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.
More in chapter: Play audio file (on page 47)
File operations This function copies, deletes or moves selected files. Optionally, a dialog for the
user can be opened before that.
More in chapter: File operations (on page 47)
Start continuous tone This function plays a selected audio file (*.wav) continuously.
More in chapter: Start continuous tone (on page 50)
Stop continuous tone This function stops the continuous playing of a audio file (*.wav).
More in chapter: Stop continuous tone (on page 50)
Window to the This function switches the zenon Runtime to the background.
background
More in chapter: Window to the background (on page 50)
Window to foreground This function switches the zenon Runtime to the foreground.
More in chapter: Window to foreground (on page 51)
Print screenshot This function prints either the current screen or the currently open screen of a
selected frame. Optionally the print-out can be routed to a fax.
More in chapter: Print screenshot
Start program This function starts an external program. Transfer parameters can be defined.
Optionally, a dialog for the user can be opened before that.
More in chapter: Start program (on page 51)
39
Functions
In the context menu of the entry Functions in the Project Manager the following commands are
available:
Parameters Description
Function new ... A new function is created and can be defined in the properties
window.
Script new A new Script (on page 65) (bundle of functions) is created.
Export XML all... 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.
Profile See chapter Profiles.
40
Functions
In order to create a new function, select the entry New function. The function selection dialog opens.
If a function is selected, you will find a dialog help in the lower part of the dialog. There the selected
function is explained. You will find more information in the chapter Overview functions (on page 8).
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.
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 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).
In order to delete a function, the function has to be selected in the detail view and deleted with the DEL
key.
41
Functions
This is possible for screens (Screen Start-end Function, Buttons), limit values, time control, scheduler,
scripts, menus, projects (automatic function execution, archive).
System functions are not limited to one module. They have an effect on the complete zenon project
configuration and control computer settings such as the selection of a printer for example.
42
Functions
Parameters 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.
Start Load Management
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.
Exit Runtime This function ends the Runtime of the control system.
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.
Language switch This function switches to a selected language in
multi-lingual projects.
43
Functions
Select printer
The printers for the different lists are generally defined in the Standard Configuration.
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.
With this function you activate the administration of the limit value functions in the Runtime.
With this function you deactivate the administration of the limit value functions in the Runtime.
With this function you can switch limit value functions between states 0 and 1 in the Runtime. The
status stored in the zenon6.ini file will be loaded when the Runtime is started:
[FUNKTIONEN]
This function loads changed Runtime files, without having to restart the Runtime.
Information
If the names of the server or Standby Server are changed in the Editor, these cannot be
loaded subsequently. They are only updated by restarting Runtime.
44
Functions
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.
Solution: Before Remote Transport is instigated, it must be ensured that screens with
*.png files:
Exit program
This function is used to exit th Runtime in a defined way (logging in CEL, close the archives, execute the
AUTOEND script etc.).
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.
After executing this function in the Runtime the next mouse click or the next touch on the touchscreen
is interpreted as a click with the right mouse button.
45
Functions
Function Save remanent data makes it possible to save remanent data at any time in the Runtime. The
function can be imported and exported. In order to configure the function:
1. select New Function
2. navigate to node Applications
3. select Save remanent data
4. the dialog for the selection of the modules opens.
Module Description
System driver and mathematics Active: Data of the system driver and of the mathematics driver are
driver saved.
Internal driver Active: Data of the internal driver are saved.
Remanent images of all drivers Active: Data of all drivers are saved.
Locking Active: Data of the locking of the command processing 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
46
Functions
This function is used to play the indicated audio file (*.wav) once whenever the function is called in the
Runtime. Provide the audio file as transfer parameter.
File Operations
This function is used to perform a defined file operation during runtime (copying, moving and deleting).
47
Functions
Give the file operation and the file parameters as the transfer parameters. This function is configured via
an input dialog.
Parameters Description
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.
Delete Delete files. 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.
48
Functions
Parameters Description
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*.)
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'.
Renaming several files simultaneously with wild cards is not possible.
Consider subfolders Looks for files also in the sub folder of the source path and creates that
tree structure in the target directory.
Attention: In conjunction with the Delete option, files and folders are
nor stored in the Recycle Bin but are deleted directly and permanently.
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.
Show dialog at Runtime Before the function is executed in online operation, a dialog box 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.
49
Functions
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: 'not older than' must be bigger than 'not younger than'.
By using this function the defined audio file (*.wav) is played repeatedly in the Runtime via a function
call until function Stop continuous tone is executed. Provide the audio file as transfer parameter.
This function stops the repeated playing of an audio file (*.wav) which has been started via function
Start continuous tone.
With this function the zenon window is switched to the background in the Runtime. The entry SYSKEY in
the file project.ini is not regarded. The selection of other applications (program manager) is
possible.
[DEFAULT]
...
SYSKEY= 0 - system keys active
1 - system keys blocked (default)
50
Functions
Window to foreground
With this function the zenon window is switched to the foreground in the Runtime. All other
applications are switched to the background (Exception: applications with the always in the foreground
property). The entry SYSKEY in the file project.ini is regarded.
Entry Meaning
[DEFAULT]
Information
At moving the Runtime to the foreground the Runtime window is defined as the topmost
window. At this the alarm status line is covered. In order to get the alarm status line back
to the foreground, you can:
activate the system keys (deactivate project settting Lock system keys) and get back the
alarm status line via Alt+Tab to the foreground
activate the Windows task bar and click un window Status
move the Runtime back to the background
restart the Runtime
Start program
This function is used to execute an external program (*.exe) from the Runtime. On executing the
function transfer parameters for the application to start can be defined.
Give the program file (*.EXE) as the transfer parameter. This function is configured via an input dialog.
51
Functions
Parameters Description
Name name of file which will be executed; search and select via button is possible
Parameters transfer parameter for program
Show this dialog in the changes program and parameter during online operation when function is
Runtime 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.
Parameters Description
@alarm.name Name of the variable
@alarm.unit unit of the variable
@alarm.value value, which violated a limit
@alarm.stext limit value text
@alarm.ctime time comes (value in seconds since 1.1.1970)
@alarm.ctimemilli with milliseconds
@alarm.gtime Time cleared
@alarm.gtimemilli with milliseconds
@alarm.qtime Time acknowledged
@alarm.user user, who quitted
@alarm.identification Identification of the variable
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 entry of the first
found list is used.
When the Chronologic Event list is active and an entry 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.
52
Functions
Parameters Description
@cel.name Name of the variable
@cel.unit unit of the variable (only if a variable is linked)
@cel.value value, which violated a limit value (only if limit entry)
@cel.stext limit value text
@cel.ctime time comes (value in seconds since 1.1.1970)
@cel.ctimemilli with milliseconds
@cel.user user, who quitted
@cel.identification Identification of the variable
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 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.).
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.
For functions where the place of execution can be freely configured, the corresponding parameters are
available in the properties of the function.
53
Functions
The following table shows which functions are executed and where they are executed.
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
54
Functions
Alarms: delete - O O
Acknowledge alarms - O O
Export AML + O
Export CEL + O
55
Functions
Application
Select printer + O
Switch palette + O
Open Help + O
Activate/deactivate project - O
simulation
Exit Runtime + O
56
Functions
Language switch + O
Topology - Search for ground fault - O
Topology - LoadShedding - O
Historian
Archive: Stop - O O
Index archive - O
Archive: Start - O O
Export archives - O
Display open archives - O O
User Administration
Change user + O
Login with dialog + O
Login without password + O
Logout + O
Change password - O
Screens
Change ALC source color + O
Indexed screen - O
Close screen + O
Screen: Return to last - O
57
Functions
Message Control
Save current queue - O
Suppress - O
groups/classes/areas/equipment
Send a Message - O
Send Message: activate - O
Send Message: deactivate - O
Network
Authorization in network + O
Redundancy switch - O
Report Generator
Print report +
Report: execute +
Export Report +
Recipes
Recipegroup Manager - O
Standard recipe - O
Standard recipe single directly + O
Standard recipe single with dialog - O
Standard recipe single with online - O
dialog
Script
Script: execute + O
Script: select online + O
58
Functions
Variable
Export data - O
Read dBase file + O
Print current values + O
Unit conversion + O
HD administration active - O O
HD administration inactive - O O
HD administration inactive/active - O O
Write set value - O
Driver commands - O
Transfer driver simulation image to - O
the standby
VBA
Open PCE editor - O
Open VBA Editor + O
Execute VBA macro + O
Show VBA macro dialog + O
VSTA
Open VSTA editor + O
Execute VSTA macro + O
Show VSTA macro dialog + O
Windows
Play audio file + O
File operations + O
Start continuous tone + O
Stop continuous tone + O
Window to the background - O
Window to foreground - O
Print screenshot + O
Start program + O
59
Functions
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.
60
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
61
Functions
Open Help 3
Exit program 3
Language switch 2
Archive: Stop 1
Index archive 1
Archive: Start 1
Export archives 1
Change user 3
Logout 2
Change password 2
Close screen 2
Screen switch 1
62
Functions
Move focus 1
Show menu 1
Monitor assign 1
Runtime profiles 1
Close frame 1
Overview Window 1
Redundancy switch 1
Report Generator Functions for reports
Print report 2
Export report 2
Report: execute 2
Recipes operating recipes
Recipegroup Manager 2
Standard Recipe 2
63
Functions
Script: execute 1
Export data 3
HD administration active 1
HD administration inactive 1
HD administration inactive/active 1
Driver Commands 2
Transfer driver simulation image to the standby 1
Write time to variable 1
Read time from variable 1
VBA VBA - Functions
64
Scripts
4. Scripts
Scripts compile several functions together in order to execute these in a sequence in Runtime. zenon
also provides some pre-defined scripts (on page 70).
65
Scripts
Editor profile Opens the drop-down list with predefined editor profiles.
66
Scripts
Symbol Description
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.
Copy Copies the selected script or the selected functions to the Windows
clipboard.
Paste Pastes an element that was copied to the Windows clipboard.
Delete Deletes the selected script or removes the selected function from
the script.
Expand/collapse Allows all or selected nodes to be expanded or collapsed. Selection:
Expand all
Collapse all
Expand selected
Reduce selected
Export selected XML Exports selected entries as an XML file.
Edit selected cell Renames the script. It is also possible by left-clicking the field with
the mouse or by pressing F2.
Parameters Description
Add functions Opens the dialog for adding functions (on page 68).
Create standard function Automatically creates a standard function for the selected script.
67
Scripts
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.
Copy Copies the selected script or the selected functions to the Windows
clipboard.
Paste Pastes an element that was copied to the Windows clipboard.
Delete Deletes the selected script or removes the selected function from
the script.
Expand/collapse node Allows all or selected nodes to be expanded or collapsed. Selection:
Expand all
Collapse all
Expand selected
Reduce selected
Export selected XML Exports selected entries as an XML file.
Edit selected cell Renames the script. It is also possible by left-clicking the field with
the mouse or by pressing F2.
To configure or edit scripts, click on the Scripts node and select the desired action in the toolbar or in
the context menu.
68
Scripts
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
You can add new functions to a script using a command or add or change the sequence of
previously-linked functions by dragging & dropping.
FUNCTION NEW
69
Scripts
zenon provides a range of pre-defined scripts. The action of this script in Runtime is pre-defined. The
functions to be executed must be configured individually.
70
Scripts
Script Description
AUTOSTART The start information (e.g. open headings and status lines, reset alarm
outputs etc.) is configured in the 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
start of the Runtime on a client and before activation of start display on a
client if the project is the Runtime start project.
71
Scripts
AUTOSTART_SRVPRJ Script will be executed automatically at the start of Runtime operation on the
computer that is the server for the project, before 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.
AUTOEND_SRVPRJ Script will be executed automatically at the end of Runtime operation on the
computer that is the server for the project, regardless of whether the project
has been defined as the start project or whether it is a sub project in a
multi-hierarchical network.
The following scripts are available for simulation mode; they are executed automatically:
72
Scripts
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.
AUTOEND_SIMUL If Runtime is ended in simulation mode, the script with the name
AUTOEND_SIMUL is executed automatically if it is available.
The following scripts are available for the HTML web engine; they are executed automatically:
Script Description
Scripts can be started in Runtime by means of functions: zenon provides two functions for this:
Script: Execute Executes a script that was pre-defined in the Editor in Runtime.
Script: Select online Allows selection of the script to be executed in Runtime.
b) Scripts with online selection in order to make it possible to select the script that is to be
executed in Runtime.
5. Confirm the configuration by clicking OK.
73
Scripts
74
Scripts
Parameters Description
List of projects (left) Selection of the project from which the script is to be selected.
Note: Ensure, when selecting scripts from a different project than the
current one, that this project is also available in Runtime.
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.
The functions of a script can be rearranged by means of Drag & Drop.
No selection Removes a pre-existing linking and closes the dialog.
OK Applies settings and closes the dialog.
With Execute script, the selected script is started in Runtime when this
function is executed.
With Script with online selection, this dialog is opened in Runtime
when this function is executed.
75
Scripts
Symbol/Command Description
Script new Adds a new script to the list.
Add functions Opens the dialog for adding functions (on page 68).
Copy Copies the selected script to the clipboard.
Paste Pastes script from the clipboard.
Expand/collapse Allows all or selected nodes to be expanded or collapsed. Selection:
Expand all
Collapse all
Expand selected
Reduce selected
Edit selected cell (only toolbar) Renames the script. It is also possible by left-clicking the field with
the mouse or by pressing F2.
Replace text in selected Opens the dialog to search and replace texts in the
column (only toolbar) currently-selected column.
With an active network, it is possible to use the properties in the Execution group to define the
computer on which the script is executed.
Information
Take care of the priorities of the script execution in the network (on page 76)
At active network you define via proeprty node Execution for scripts where the script is executed:
Current computer
Client
Server
Standby
This execution location is true for functions contained in the script. Function which had a different
execution location assigned, take over the execution location defined here.
76
Select Functions and scripts dialog
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
77
Select Functions and scripts dialog
The dialog offers the possibility to select functions and to configure scripts:
Functions selection (on page 78): Selection of a function or creation of a new function
Script selection (on page 79): 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 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.
78
Select Functions and scripts dialog
Parameters Description
List of projects (left) Selection of the project from which the function is to be
selected.
Note: Ensure, when selecting functions from a different project
than the current one, that this project is also available in
Runtime.
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.
Functions can be created and edited using the toolbar and
context menu. New functions and changes are saved
immediately.
Symbol/Command Description
Function new Adds a new function to the list.
Copy Copies the selected function to the clipboard.
Paste Pastes a function from the clipboard.
Selection and configuration of scripts that are to be linked, as well as assignment of the Script: execute
function.
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 Runtime.
2. Select the desired script.
79
Select Functions and scripts dialog
80
Select Functions and scripts dialog
Parameters Description
List of projects (left) Selection of the project from which the script is to be selected.
Note: Ensure, when selecting scripts from a different project
than the current one, that this project is also available in
Runtime.
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.
The functions of a script can be rearranged by means of Drag &
Drop.
Function: Script: execute Selection of the function that is to execute the selected script
from a combo box.
The combo box contains, in a drop-down list, all functions that
have already been defined that can execute the selected script.
The name for a new function to execute the script can be
entered in the input field.
OK Accepts the selected or newly-issued name for the Script:
execute function, links the selected script and closes the dialog.
Cancel Closes the dialog without linking a script.
Help Opens help
No selection Removes a pre-existing linking and closes the dialog.
81
Select Functions and scripts dialog
Symbol/Command Description
Script new Adds a new script to the list.
Add functions Opens the dialog for adding functions (on page 68).
Copy Copies the selected script to the clipboard.
Paste Pastes script from the clipboard.
Expand/collapse Allows all or selected nodes to be expanded or collapsed. Selection:
Expand all
Collapse all
Expand selected
Reduce selected
Edit selected cell (only toolbar) Renames the script. It is also possible by left-clicking the field with
the mouse or by pressing F2.
Replace text in selected Opens the dialog to search and replace texts in the
column (only toolbar) currently-selected column.
82