beautypg.com

Event scripts – Micromod MOD: 30ML Display Script Guide User Manual

Page 42

background image

MOD 30ML Display Guide

Display Scripts

defined. For example, pressing the Scroll key may be used to change what is displayed on
Line 6 most of the time, but under a particular circumstance might also be used to scroll
through a custom menu permitting an operator to turn a valve on or off. For this example
two Display States would be required along with an event that would cause the Display
State to change. In each Display State the Scroll key is defined for a different function.

The command used to change Display States is DSPSTATE = xxxxx, where xxxxx is the
name of the target Display state. The Display block manages multiple Display States by
assigning a count value to each state name. DEFAULTS is automatically assigned the
value 0 (zero). Each new state name is assigned a subsequent value. Based on this,
changing Display States can be done by using the Display State value in place of the
actual Display State name. Example: DSPSTATE = 1.

When developing a Display Script, start with the state name followed by a colon, for
example, DEFAULTS:

3.2.2 Event

Scripts

Each Display State is made up of Event Scripts which cause a particular section of script
to be executed
, for example, causing an action when the Scroll key is pressed. There are
27 events pre-defined in MOD 30ML. Twenty-four events are defined as key events and
three are defined as display events. Key and display event names are listed in Table 3-1.

A key event occurs when any of the eight keys on the front panel is PRESSED, HELD or
RELEASED. This is similar to the “make” and “break” statements used in other keyboard
applications. For a key to be detected as RELEASED or HELD it must first be detected as
having been PRESSED. Therefore if a key has been given both a PRESSED and a
RELEASED event, the PRESSED function is processed first and then the RELEASED
function when the key has been released. For a key to be detected as HELD the key must
be held in for a minimum of one second.

The three display events are ENTRY, EXIT and ACTIVE. ENTRY and EXIT are run on
entry to and exit from a display state. ACTIVE is run continuously while in a given state.
Therefore, for most applications, which use only one Display State, only the ACTIVE
event script is used.

When a Display block, more specifically a Display State, is executed for the first time
script defined under the ENTRY event will be executed one time. Likewise, script
defined under the EXIT event is executed once when leaving the display (or Display
State). Script defined under the ACTIVE event will be executed each time the Display
block is executed.

When defining an event, type the event name followed by a colon, for example,
SCROLL_PRESSED:

Table 3 .1

3 - 4