Topic: DMD0081

Help File Version: 2.10.0.636

REPEAT - Loop Until Condition is Non-Zero


The Loop Until Condition is Non-Zero (REPEAT) instruction begins a Repeat / Until loop in which the rungs ladder logic instructions between the Repeat instruction and the UNTIL instruction will be executed until the ending Condition location is Non-Zero. The terminating condition is specified in the corresponding UNTIL instruction. Repeat / Until loops can be nested, and there is no limit to how deep the nesting can go.

 

The looping instructions are unconditional so they will run any time the code-block in which they reside is enabled. The preferred method for making them conditional is to place the loop in a Task code-block and use the Enable Task (ENTASK) instruction to run the loop whenever required.

 

 

This instruction is a 'power-rail' instruction, meaning that it is displayed in the left-most column of the ladder diagram (the power rail). Creating new instances of this instructions is a bit counter-intuitive because they cannot be entered directly on the power rail in the Ladder Editor. The first step is to position the edit cursor in the output column (the far right) of the rung in the ladder logic diagram instead of positioning it against the power rail (the far left). At that point you can enter the instruction's mnemonic or double click on the instruction's name in the Instruction Toolbox. You can also drag / drop the instruction from the Toolbox anywhere on the rung and it will be created in the power rail of that rung.

 


Parameters:

There are no parameters for this instruction.

 


Status Display:

 

The REPEAT instruction will show the current .TimeSlice value of the Program or Task when status is ON.

 


See Also:

BREAK - Exit Loop

 

CONTINUE - Skip to Loop End

 

FOR - Index Loop

 

NEXT - Index By Step

 

REPEAT - Loop Until Condition is Non-Zero

 

UNTIL - Repeat Until Condition is Non-Zero

 

WEND - While End

 

WHILE - Loop While Condition is Non-Zero

 


Rung Example: