Description: This function returns true when the uninterrupted time that an expression is true reaches the specified value.
Returns: Boolean
Usage: Steady State
Format: TimeOut(Enable, Time)
Parameters: Enable { numeric } { required } { no default: }
Any numeric expression giving the condition that results in the timer counting. When this parameter is true (not 0), the timer is "running." When this parameter is false (0), the timer stops and the timer is reset to 0.
Time { numeric } { required } { no default: }
Any numeric expression giving the time-out limit in seconds. When the cumulative time that Enable is true reaches this value, the function becomes true (1). If this value is 0 the function will trigger immediately and will continue to trigger as long as the state containing this function is active.
Comments: This function is reset when either parameter becomes invalid, the Enable becomes false, or when the state containing the function is started. When the function is reset, counting starts at 0 and the returned value is false (0).
Note that this function is reset automatically when it occurs in a true action trigger or function parameter of a function which resets its parameters after evaluation (e.g. Latch, Toggle & Save).
Example:
ZText(10, 10 { Lower left corner of text },
"Emergency!" { Text to display },
Cond(Toggle(TimeOut(1, 0.3)), 12, 4
{ Toggle lt red/dark red every 0.3 secs }),
0 { Default font });
This displays a message which flashes bright red and dark red every 0.3 seconds. Another common usage of the TimeOut function is as an action trigger for a script:
If TimeOut(1, 5) NextState;
[
...
]
This script will be executed 5 seconds after entering the state, and then a state change to NextState will occur.
See Also: