Crestron SIMPL+
Language Reference Guide - DOC. 5797G
®
Wait
Name:
Wait
Syntax:
Wait(INTEGER TIME[, NAME])
[{]
<statements>
[}]
Description:
NOTE: There is no semicolon after a WAIT statement because it has a clause or block
following it.
Adds an event to a list to be executed in TIME hundredths of a second. Giving a
WAIT a name is optional, but to cancel, pause, resume, or retime a wait, a name must
be specified. A currently running WAIT will finish before being entered into the
WAIT list again. For example, if in an endless WHILE loop, a second WAIT will
only begin after the first finishes.
When the system encounters a WAIT, the event is put into the WAIT scheduler. The
SIMPL+ module continues to execute without interruption. At some point, a task
switch will occur (either due to event termination or other means, refer to "Task
Switching" that begins on page 8). The WAIT schedule is checked by the operating
system after a task switch, and if a wait event needs to be serviced, it is run and then
terminates. Note that the module may task switch away while inside the WAIT, just
like in other events.
AWAIT statement differs from a DELAY in both timing and order of statement
execution. In a WAIT statement, the WAIT block executes only after the specified
amount of time, but execution proceeds immediately to the statement following the
WAIT block. In a DELAY, all execution is halted until the delay is finished.
Parameters:
TIME is an integer, expressed in hundredths of a second. For example, 525 specifies
a wait time of 5.25 seconds.
NAME is an optional name given to the WAIT event. It has the same syntax as a
variable name. Note that you cannot put two separate WAIT statements in the same
SIMPL+ program that have the same NAME (this will cause a compilation error).
NOTE: (2-Series Only) The only variable types that are allowed to be used within a
Wait Statement block are global variables and variables declared locally within the
Wait Statement's block. Local variables declared within the function containing the
Wait Statement are not allowed.
Software
®
SIMPL+
265
Need help?
Do you have a question about the SIMPL+ and is the answer not in the manual?
Questions and answers