omron — EXIT program instruction

EXIT program instruction EXIT program instruction Syntax EXIT count Function Branch to the statement following the nth nested loop of a control structure. Usage Considerations This instruction works with the FOR, WHILE, and DO control structures. Parameter count Optional integer value (expressions and variables are not acceptable) specifying how many nested structures to exit. The default value is 1. Details When an EXIT instruction is reached, the control structure is terminated and execution continues at the first instruction following the outermost control structure exited. Example If input signal 1001 is set, exit one control structure; if 1002 is set, exit three control structures:

27 FOR i = 1 TO 40 28 WHILE ctrl.var DO 29 DO 30 IF SIG(1002) THEN 31 EXIT 3 ; Jump to step 40 32 END 33 IF SIG(1001) THEN 34 EXIT ; Jump to step 37 35 END 36 UNTIL FALSE 37 count = count+1 38 END 39 END Related Keywords DO program instruction FOR program instruction NEXT program instruction eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 214