3.155
EDH0162En1040 – 06/99
MM4005
WE — End While loop
Usage
IMM
PGM
MIP
Syntax
WE
Parameters
None.
Description
This command terminates a WHILE loop initiated by any of the WG, WH,
WL or WY commands.
Up to 100 While loops can be nested, but they must follow the general rule
of multiple loops: last one opened is the first one closed.
NOTE
To be accepted, WE must be placed on a different line than WG, WH, WL
or WY. To improve program clarity, it is recommended to place the WE
on a separate line.
NOTE
All While loop commands (WG, WH, WL and WY) must be terminated
with a WE command.
Returns
None.
Errors
J
—
Command authorized only in programming mode.
Rel. Commands
WG
—
While variable greater than value.
WH
—
While I/O input is equal.
WL
—
While variable is less.
WY
—
While variable is different.
Example
2YS0 |
Initialize variable #2 to 0.
2WY10, 2YA1
|
Open first while loop: while variable #2 is different than 10, add 1 to
variable #2.
5WH1, 3PR1.2, WS
|
Open second while loop: while I/O input bit #5 is high, move axis #3
incremental 1.2 units and wait for stop.
WE
|
End second while loop.
WE
|
End first while loop.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com