SPLat Logo

WaitOnKT ii+,tttt

NOTICE: Our web site is being updated, but is currently experiencing extreme slowness due to host issues. Please contact us directly.
NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map
SPLat will be shut down for the Christmas Holiday season from Friday 20 December 2024 through Tuesday 7 January 2025. We will check emails periodically and will continue to process orders but at a slower pace. Santa hat

WaitOnKT ii+,tttt

This instruction is like the WaitOnK instruction, but with a built in time limit of tttt x 10mS. 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. When the instruction has executed, the next line of code should test the value in X to determine the outcome. X will be true if the expected event (an OFF to ON input transition on input ii) occurred. If the transition did not occur, X will be False.

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.

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.

Executing the WaitOnKT instruction clears any latched transition, so a new OFF to ON transition would be required for a second WaitOnKT to return a True value.

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

Dialect exclusions: Not available in dialects before 9.

See also ResetK InputK WaitOn WaitOnT WaitOff WaitOffT WaitOnK Pause