Example 4: variable ramping with two keys, 4 example 4: variable ramping with two keys – Micromod MOD: 30ML Display Script Guide User Manual
Page 67

MOD 30ML Display Guide
Application Examples
5.4 Example 4: Variable Ramping with Two Keys
The standard method of changing a variable on Line 6 is to press either the UP or DOWN
arrow, use the FAST / SLOW keys to select the digit to be changed, then use the UP /
DOWN arrows to make the change.
Some operators may prefer a two-key operation to change the value of setpoint, output or
other parameters. In this example , the operator holds down the arrow key for the desired
direction of change, and presses the opposite direction key to move the cursor to the left
(e.g. holding down the UP key and pressing the DOWN key twice increments the second
digit to the left).
The TAG and Alarm keys function as they are defined by the operating system. Because
the UP / DOWN keys normally interact with the SCROLL, AUT and MAN keys, the
script for these keys must also be re-defined.
Four new Display Inputs are required in addition to those shown in Example 1. They are:
• DOWNHLD - identifies that the down key is being held
• UPHLD - identifies that the up key is being held
• DWNCOUNT – used to count the number of times the down key is pressed and
determine which digit is changing
• UPCOUNT – used to count the number of times the up key is pressed and
determines which digit is changing.
When defining a script for the UP and DOWN keys, a separate IF-THEN-ELSE statement
is needed for each variable to be manipulated. This can cause the script to be lengthy if
variables other than Setpoint and Output are involved. The ramping scripts are contained
in a Display State called “ACTIVE”, which is executed every 50 milliseconds. The
imcrement values, therefore, are actually multplied by 20, giving a ramp speed of 2 counts
per second.
Note that all timer values are derived from the 50ms execution time.
Remember that the values for the UP/DOWN key resource (#UPDN) assignments are:
0 = No display
1 = Up arrow
2 = Down arrow
3 = slash
4 = Up arrow and slash
5 = down arrow and slash
6 = Up arrow, down arrow and slash
7 - 65535 = Return to system definition
No new formats are needed, and the default State Table file is used.
5 - 13