beautypg.com

Micromod MOD: 30ML Functions Data Base Reference User Manual

Page 24

background image

MOD 30ML Functions

DISPLAY BLOCK

Event Scripts
Each state consists of up to 27 event scripts, the names of which are predefined. Key event
scripts, listed below, correspond to the state of each key. The display event scripts ENTRY
and EXIT are run on entry to and exit from a state. The display event script ACTIVE is run
continuously while in a state and the display block is active.

Key Event Scripts:

ALARM_PRESSED

ALARM_HELD ALARM_RELEASED

TAG_PRESSED

TAG_HELD

TAG_RELEASED

MANUAL_PRESSED

MANUAL_HELD

MANUAL_RELEASED

AUTO_PRESSED

AUTO_HELD AUTO_RELEASED

RL_PRESSED

RL_HELD

RL_RELEASED

SCROLL_PRESSED

SCROLL_HELD

SCROLL_RELEASED

UP_PRESSED

UP_HELD

UP_RELEASED

DOWN_PRESSED

DOWN_HELD

DOWN_RELEASED

Display Event Scripts:

ENTRY

ACTIVE

EXIT


Pressed and released are one-shot key events. Held status persists after a key is pressed for
1 second. Key status is managed by the DIF block at each 50 msec tick.

Key Event and Display Event Scripts
Each event script consists of zero or more IF statements, CASE statements, assignment
statements, TUNE statements, or RETURN statements. In the examples below, statement
can be bracketed multiple statements.

IF Statements
The IF statement executes statement(s) immediately following THEN if the conditional
expression evaluates to True. Otherwise, IF executes statement(s) following ELSE. The
general format of the IF statements are:

IF-THEN-ELSE statement: IF-THEN statement:

IF expression THEN IF expression THEN
Statement1; Statement1;
ELSE
Statement2;

CASE Statements
A CASE statement tests whether the result of its expression matches one of a number of
integer values, and branches accordingly. Each case is labeled by one or more integers, or
the keyword "DEFAULT". If the expression matches one of the integer labels, the statements
associated with that label are executed, otherwise, the statements associated with the
DEFAULT label are executed. The DEFAULT case is optional - if it isn't present and the
expression does not match one of the other cases, no statements are executed.

Cases can be listed in any order. Integer labels must be unique and must be in the range 0 to
65535. Up to 255 cases may be present, not including the DEFAULT case. If the expression
evaluates to a value outside the range 0 to 65535, the default case is executed, if present.

The break statement causes an immediate exit from a case statement. As a general rule, the
last statement for each case should be a break statement, although it is not required. After
the statements associated with a case are done, execution continues with the statements for
the next case unless a break statement is present to prevent this.

The general format of the CASE statement is:
CASE expression OF
{

2-16