beautypg.com

11 repeat loop, 12 exit instruction, Repeat loop – Lenze DDS v2.3 User Manual

Page 48: Exit instruction, Drive plc developer studio

background image

Drive PLC Developer Studio

Programming languages

4-10

l

DDS EN 2.3

4.3.11

REPEAT loop

The REPEAT loop differs from the WHILE loop in that the cancel condition will only be checked after
the loop has been carried out. This means that the loop must be executed at least once no matter
what the cancel condition is.

Syntax:

REPEAT

UNTIL

END_REPEAT

;

The are executed until returns TRUE.

If returns TRUE on first evaluation already, the

will be executed exactly once.

If is never TRUE, the will be repeated
endlessly, forcing a runtime error.

Example:

REPEAT
Var1:=Var1*2;

Counter:=Counter-1;
UNTIL
Counter=0

END_REPEAT

;

4.3.12

EXIT instruction

If the EXIT instruction is part of a FOR-, WHILE or REPEAT loop, the loop will be terminated
irrespective of the cancel condition.

In nested loops, EXIT terminates the innermost loop.

Show/Hide Bookmarks