Basic instructions
8.8 Program control operations
S7-1200 Programmable controller
324 System Manual, V4.2, 09/2016, A5E02486680-AK
Table 8- 164 EXIT instruction
An EXIT statement is used to exit a loop (FOR, WHILE or REPEAT) at any point, regardless of whether
the terminate condition is satisfied.
The EXIT statement executes according to the following rules:
● This statement causes the repetition statement immediately surrounding the exit
statement to be exited immediately.
● Execution of the program is continued after the end of the loop (for example after
END_FOR).
Use the EXIT statement within a loop. In nested loops, the EXIT statement returns the
processing to the next higher nesting level.
FOR i := 0 TO 10 DO
CASE value[i, 0] OF
1..10: value [i, 1]:="A";
11..40: value [i, 1]:="B";
41..100: value [i, 1]:="C";
ELSE
EXIT;
END_CASE;
END_FOR;