REPEAT  UNTIL  END_REPEAT

Statement - Repeat a list of statements.

Syntax

    REPEAT 
        <statements>
    UNTIL <BOOL expression>
    END_REPEAT;

Remarks

  • The statements between REPEAT and UNTIL are executed until the Boolean expression is TRUE.
  • The condition is evaluated after the statements are executed.
    • Statements are executed at least once.

  • Loop instructions can lead to infinite loops that block the target cycle.
    Never test the state of an input in the condition because the input is not refreshed before the next cycle.

FBD Language Example

Not available.

FFLD Language Example

Not available.

IL Language Example

Not available.

ST Language Example

iPos := 0;
REPEAT
   MyArray[iPos] := 0;
   iNbCleared := iNbCleared + 1;
   iPos := iPos + 1;

UNTIL iPos = iMax
END_REPEAT;

See Also