SPLat Logo

WaitOffT ii+,tttt

NOTICE: We are updating our website. For product enquiries and orders please contact us directly.
NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map

WaitOffT ii+,tttt

(T=Z;Z=Y;Y=X); PC = ((<input ii> == 0) || (tttt ticks elapsed)) ? (PC + 1) : PC; X = (timeout occurred) ? FALSE : TRUE

(A FastTrack instruction)

Waits until the nominated input number ii turns off, but with a time limit. If the input is already off when this instruction is executed, your program will simply go on to the next instruction. If the input is on, the program will wait until it turns off, 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 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.

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).

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


On SPlat 8bit 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.

See also WaitOn WaitOnT WaitOff WaitOnK WaitOnKT Pause