Waitwait statement, While/endwhilewhile statement, Wait – Lenze PMSS1000 Simple Servo User Manual
Page 72: Wait statement, While/endwhile, While statement
![background image](/manuals/566049/72/background.png)
Indexer-Programmer-Manual.pdf REV 1.3
72
WAIT
Wait
Statement
Purpose
Suspend program execution until some condition(s) is met. Conditions include
Expressions TRUE or FAULSE, Preset TIME expiration, MOTION COMPLETE.
Syntax
WAIT UNTIL <expression> ;wait until expression becomes ;TRUE
WAIT WHILE <expression> ;wait while expression is TRUE
WAIT TIME <time delay>
;wait until <time delay> in mS is ;expired
WAIT MOTION COMPLETE ;wait until last motion in Motion Queue completes
Remarks
See Also
DSTATUS System Variable, User Variables and Flags section
Example:
WAIT UNTIL (APOS>2 && APOS <3)
WAIT WHILE (APOS <2 && APOS>1)
WAIT TIME 1000
;wait 1 Sec (1 Sec=1000mS)
MDV 20, 20
MDV
20,0
WAIT MOTION COMPLETE
;waits until motion is done
WHILE/ENDWHILE
While
Statement
Purpose
The WHILE <expression> executes statement(s) between keywords WHILE and
ENDWHILE repeatedly while the expression evaluates to TRUE.
Syntax WHILE
<expression>
{statement(s)}…
ENDWHILE
Remarks
WHILE block of statements has to end with ENDWHILE keyword.
See Also
DO/UNTIL
Example:
WHILE
APOS<3
;execute statements until position
; less than
;preset limit
…{statement(s)}..
ENDWHILE