Example 5: time-based variable ramping, Xx.x – Micromod MOD: 30ML Display Script Guide User Manual
Page 72

MOD 30ML Display Guide
Application Examples
5.5 Example 5: Time-Based Variable Ramping
In some controllers, the longer the up or down ramp key is held, the faster the variable
changes. In this example, for the first two seconds the tenths digit will ramp at a rate of
0.2 counts per second. Then the ones digit will ramp at a rate of 2 counts per second for
two seconds, and finally the tens digit will ramp at a rate of 20 counts per second, as
illustrated in the next figure.
Ramp speed of
time-based ramping
example
XX.X
20 per
second after
first 4
seconds
2 per second
for next two
seconds
.2 per second for first
two seconds
This example is based on the configuration shown in Example 1. As with Example 4, the
UP and DOWN keys must be re-defined, and much of the script is similar. The TAG and
Alarm keys remain under default (system) control.
In addition to the PID100 inputs and the four inputs defined in Example 4, one new count
input called TIMER is used. This simply counts from 0 to 200, resets, and begins again.
Because the script executes every 50ms, it will take ten seconds for the timer to count to
200 and reset. This is used to determine how long a key is held.
In the portion of the script that causes the UP ramping, there is a series of IF statements.
When the first IF statement is true, the output will be incremented by a value of .01 each
time that the display block is processed (20 times per second). This means that each
second the tenths digit will increase by a value of .2. If the value of TIMER is greater
than 40 but less than or equal to 80, the first IF statement is false and the second IF
statement is true. This causes the ones digit to increment at a rate of 2 counts per second
for 2 seconds (80 - 40 = 40 x .05 sec. = 2 seconds). Finally, if the value of TIMER is
greater than 80, only the third IF statement is true, and the tens digit increments at a rate of
2 counts per second. The length of time left to ramp to full scale is 6 seconds (200 - 80 =
120 x .05 sec. = 6 seconds).
If the upper engineering unit range value for the variable being changed is large, you
may have to increase the upper value of the local input named TIMER to a value which
provides enough time for the full ramping to occur. Likewise, if you wish a change of
speed to occur at a different time value than two seconds then change the TIMER trip
points in the ACTIVE script.
5 - 18