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