Device: the egg timer – Rockwell Automation 2708-DH5B2L_DH5B4L Attended Workstation User Manual
Page 112
Chapter 12
Special Devices in A-B VBASIC
12–16
Reserved device name: EGG
Description:
The egg timer is a word of memory which, when non-zero, is decremented
by one every 1/100 second.
These statements, when used with the file number associated with an OPEN
“EGG”, control this timing device:
SEEK statement: sets the timer to an integer or long
For example:
OPEN “EGG” FOR INPUT AS #4
SEEK #4, 1000
sets the timer to reach 0 in ten seconds.
SEEK function: returns the current value of the timer as a LONG value.
(LONG is used to avoid sign confusion for values over 32767 with an
INTEGER).
LOF and LOC also return the timer’s current value.
EOF returns TRUE (-1) when the timer “goes off” by reaching zero. This
device is an easy way to implement delays and timeouts without the midnight
rollover problem associated with TIME$ and TIMER.
Device: The Egg Timer