2-35
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
ST Statement Instructions
2
REPEAT
The following processing flow is for this example. You can use more than one statement.
REPEAT
statement;
UNTIL condition expression
END_REPEAT;
• The statement is executed once before the condition expression is evaluated. Therefore, the state-
ment is always executed at least once.
• There are no restrictions on the statements that you can use. You can use the same types of state-
ments for the statements in the REPEAT construct as you do for the statements outside the REPEAT
construct. For example, you can use function block calls and FOR constructs.
• You must always use REPEAT, UNTIL, and END_REPEAT. They must be used as a set.
• You can use a hierarchy that is 15 levels deep, but count all levels of IF, CASE, FOR, WHILE, and
REPEAT constructs.
This example adds INT#1 to variable abc until the value of variable abc exceeds INT#10.
Additional Information
Precautions for Correct Use
Sample Programming
FALSE
TRUE
Condition
expression
Statement
abc:=INT#0;
REPEAT
abc:=abc+INT#1;
UNTIL abc>INT#10
END_REPEAT;
abc 0
INT
Variable
Data type
Initial value