3 do-end and while-do-end commands – Rockwell Automation 8520 9/Series CNC Lathe User Manual

Page 684

Advertising
background image

Paramacros

Chapter 28

28-10

When block N2 is read, parameter #3 is compared to the value -1.5. If the

comparison is true, then blocks N3 and N4 are skipped, and execution

continues on from block N5. If the comparison is false, then execution

continues to block N3. When block N6 is read, parameter #4 is compared

to the value 3. If the comparison is true, then execution is transferred to

block N1; if it is false, execution continues to block N7.

Unconditional DO-END

The unconditional DO-END command is rarely used. The lack of a

condition here causes the control to loop indefinitely until reset or

<CYCLE STOP>

is pressed, or until some other transfer of control command

forces execution out of the loop.

The format for the unconditional DO-END command is as follows:

DO m;
:
:
:
END m;

Where :

Is :

m

a loop identifier used to relate a DO block with an END block. The value of m

must be the same for the DO as it is for the corresponding END. This value can

be either 1, 2, or 3.

All blocks between the DO and the END command are executed

indefinitely or until execution is stopped by some external operation such

as by pressing

<E-STOP>

or

<CYCLE STOP>

, or when a block delete is

performed if programmed.

Conditional WHILE-DO-END

The conditional WHILE-DO-END command is dependant on whether a

mathematical condition is true. If this condition is false, execution will

transfer to the block immediately following the END statement block.

28.2.3

DO-END and

WHILE-DO-END Commands

Advertising