Topic: DMD0078 CONTINUE - Skip to Loop End |
|
The Skip to Loop End (CONTINUE) instruction stops execution of the current iteration of a For / Next, While / Wend, or Repeat / Until loop by skipping over all of the ladder logic instructions between CONTINUE instruction and the NEXT, WEND, or UNTIL instruction that ends the loop.
Program execution continues with the next iteration of the loop, or if the terminating condition of the loop is TRUE, continues with execution of the instruction immediately after the NEXT, WEND, or UNTIL instruction.
Parameters:There are no parameters for this instruction.
|
|
Status Display:
The green triangle in the upper left corner indicates this is a Skipping instruction.
|
|
See Also:
CONTINUE - Skip to Loop End
REPEAT - Loop Until Condition is Non-Zero
UNTIL - Repeat Until Condition is Non-Zero
WHILE - Loop While Condition is Non-Zero
|
|
Example:The following simple example uses V100 as the loop index. It will be initialized to 4000 (From) on the first pass through the loop, and will increment by 1 (By Step) on each successive pass until it gets to 4009 (To).
Each pass through the loop the comparison contact will compare the value in D[V100] - which is D4000, D4001, D4002 ... D4009 - to the value in D4010. If the value in D[V100] is greater than the current value in D4010, the value in D[V100] will be copied to D4010.
If a negative value is found that comparison step is skipped by a Continue instruction.
|
|