WaitOnT ii+,tttt
(A FastTrack instruction)
Waits until the nominated input number ii turns on, but with a time limit. If the input is already on when this instruction is executed, your program will simply go on to the next instruction. If the input is off, the program will wait until it turns on, but with a maximum wait time defined by the argument tttt. tttt is given in multiples of 10mS, up to a maximum of 32,767 x 10mS for dialects before 16, and 16,777,215 x 10mS for dialects 16 and later.
From dialect 20 some controllers allow you to program the 10mS basic "tick" interval over the range 1mS to 255mS via a setting in the CPU device. See the CPU device documentation for your controller.
If the expected input occurs within the allowable time limit, the instruction Pushes a True value into X. If on the other hand the timeout occurred, the instruction Pushes a False value into X. A simple conditional GoTo (GoIfT or GoIfF) can test the outcome. (This all becomes clear in the FastTrack tutorial).
From dialect 16 this instruction becomes non-blocking when executed inside a MultiTrack task. When encountered in a MultiTrack task, it will always yield the processor the first time it is executed and continue yielding until the time has expired or the input condition is met.
This instruction uses debounced inputs. Debounce adds a delay of 8 to 20mS to the input response, in order to reject contact bounce (chattering) in mechanical input switches.
When this instruction is simulated it has a special time display. Also, the simulated timing of the regular timers is unrelated to the timing of this instruction.
+ From dialect 16 the address argument will be jndexed when executed inside a MultiTrack task and will be indexed if the instruction is preceded by the IasJ:
precode.
Note:
On SPlat 8 bit controllers (green boards) you cannot use Pause,
WaitOnT
,
WaitOffT
or WaitOnKT
inside a MarkTime
/LoopIfTiming
loop.
However on SPLat 32 bit controllers (black boards) there is no such restriction. On these boards you can use any combination of these instructions at any time. There are full details on other 32 bit board enhacements.