Delays further execution of a thread for a specified number of Trajectory Generator periods.
Controller.SleepTick(ticks)
-or-
Controller.SleepTick
Prerequisites
None
Parameters
ticks
An optional numeric expression that specifies an Integer number of Trajectory Generator periods that execution is to be delayed. If this parameter is not specified, the value is defaulted to 1.
Remarks
Often times, a program must poll input data values periodically. While it is possible to use a “busy loop” that counts for a fixed number of times, this technique unnecessary consumes CPU time that could be more productively spent by system drivers or other GPL threads. The SleepTick method allows a thread to relinquish control of the CPU for a specified period of time and then resume execution at the next sequential statement.
Since many operations are synchronized to the operation of the Trajectory Generator, the delay time for this method is specified in units of Trajectory Generator execution periods.
Please note that other programming languages like Basic typically have other means for putting a thread to sleep for a specified period of time.
Examples
Controller.SleepTick ' Delays thread execution until
' after the start of the next
' trajectory cycle
Controller.SleepTick (2/Controller.Tick) ' Delays thread execution for
' approximately 2 seconds
See Also