178 C1553M-B (4/05)
Scripts and Expressions
Use scripts and expressions as tools to automate your system. Scripts and expressions are defined as follows:
Scripts: A script is a custom program written within VMX300(-E). Scripts are used to automate common tasks and to ensure that the
correct conditions exist before a particular action takes place.
Expressions: Expressions are used to detect a condition that triggers an action. For example, when the expression associated with a timer
becomes true, the timer starts. Similarly, when the expression associated with an alarm or event becomes true, recipients are notified and
the alarm/event’s script is executed. Expressions are also used in IF statements.
You can use the following types of scripts in a VMX300(-E) system:
Local Scripts: Most scripts are local, that is, they cannot be run from other scripts. This includes scripts associated with the following:
– Labels
– Hotlinks
– Timers
– Prompts
– Schedules
Alarms and events
Global scripts: Global scripts can be run from other scripts. If there is an action you want performed by more than one script, define the
action in a global script and then call it from the other scripts. Refer to Global Scripts for more information.
VMX300(-E) provides the following tools to help you develop error-free code:
Context-Sensitive Help: These are pop-up menus that offer valid options for the current position within a statement. Refer to Context-
Sensitive Help for Scripts and Context-Sensitive Help for Expressions for more information.
Expression Wizard: This wizard steps you through the creation of an expression. Refer to The Expression Wizard for more information.
Script Wizard: This wizard steps you through the creation of a statement. Refer to The Script Wizard for more information.
Syntax Error-Checking: Hover help containing error messages and information on command syntax, is available as you enter each line of a
script. When you save the server configuration, syntax errors are identified, and tools are provided to edit the objects containing errors.
Refer to Syntax Error-Checking for more information.
When you edit a script, you must make it available in its updated form by saving the server configuration.
TIP: Use global tags to implement script return values. For example, if you have a prompt with three buttons, set global tags to reflect
which button the operator clicked, to pass back to the script that called the prompt. Refer to Global Tags for more information.