The IEC 61131-3 ST REPEAT statement executes a list of statements until a condition is true. The REPEAT Statement has this syntax:
REPEAT Statement; Statement; .. Statement; UNTIL Condition END_REPEAT;
Where:
The statements inside the REPEAT loop are executed until the condition becomes true.
The list of statements inside the REPEAT statement will always be executed at least once.
To stop the REPEAT loop early (before the condition becomes true) use the EXIT Statement.
The REPEAT Loop uses this logic to execute statements:
Index := 0; Sum := 0; REPEAT Sum := Sum + Values[ Index ]; Index := Index + 1; UNTIL Index >= 10 END_REPEAT;
IEC 61131-3 Second Edition: Table 56.8.
IEC 61131-3 Third Edition: Table 72.8.
For information about another loop type that uses a condition.
For information about another loop type that uses a fixed number of iterations.
For other Structured Text (ST) statement types.
To learn about expressions that can be used as the condition in a REPEAT loop.
For the meaning of terms used in Fernhill SCADA.