WHILE/ENDWHILE – Conditional loop
The commands described here are only available when writing a standalone program.
Runs a series of statements as long as a given condition is True.
Applies to: CMD-4CR, CMD-4EX-SA, PMX-4EX-SA, PMX-4ET-SA, PMX-2ED-SA, PMX-2EX-SA
Standalone WHILE
ENDWHILE
Syntax:
Write:
WHILE [condition]
[statement]
ENDWHILE
Where: [condition] Required. Expression. Must evaluate to True or False using a relational operator. [statement] One or more statements to be executed while [condition] is TRUE |
Reply:
Command is accepted and executed
No Reply
Example:
Write:
WHILE V1<10 * Loop while variable 1 is less than 10
X1000 * Move to 1000 (for X-axis)
WAITX * Wait for X-axis move to complete
X0 * Move to zero (for X-axis)
WAITX * Wait for X-axis move to complete
V1=V1+1 * Incremental variable 1
ENDWHILE * Go back to WHILE statement
Notes:
- None
See also:
Standalone Programming Commands