2 Instruction Descriptions
2-34
NJ-series Instructions Reference Manual (W502)
REPEAT
The REPEAT construct executes a statement once and then executes it repeatedly until a specified
condition expression is TRUE.
None
The REPEAT construct executes a statement once and then executes it repeatedly until a specified
condition expression is TRUE. Use a condition expression that evaluates to TRUE or FALSE.
You can use the following operators in the logic expression.
Instruction Name FB/FUN Graphic expression ST expression
REPEAT Repeat --- None REPEAT
statement;
UNTIL condition expression
END_REPEAT;
Variables
Function
Item used for condition
expression
Example Evaluation result
Logic expression
a>3 If the value of variable a is greater than 3, the result is TRUE. Oth-
erwise, the result is FALSE.
a=b If the values of variables a and b are equal, the result is TRUE. Oth-
erwise, the result is FALSE.
BOOL variable abc If the value of variable abc is TRUE, the result is TRUE. If it is
FALSE, the result is FALSE.
BOOL constant TRUE TRUE
Function with a BOOL
return value
FUN name If the function returns TRUE, the result is TRUE. If it returns FALSE,
the result is FALSE.
Operator Meaning Example Evaluation result
= Equals a=b If the values of variables a and b are equal, the result is TRUE.
Otherwise, the result is FALSE.
<> Not equals a<>b If the values of variables a and b are not equal, the result is
TRUE. Otherwise, the result is FALSE.
<
Comparison
a<b If the value of variable a is less than the value of variable b, the
result is TRUE. Otherwise, the result is FALSE.
<= a<=b If the value of variable a is less than or equal to the value of
variable b, the result is TRUE. Otherwise, the result is FALSE.
> a>b If the value of variable a is greater than the value of variable b,
the result is TRUE. Otherwise, the result is FALSE.
>= a>=b If the value of variable a is greater than or equal to the value of
variable b, the result is TRUE. Otherwise, the result is FALSE.
AND (&) Logical AND a AND b
a & b
The result is the logical AND of BOOL variables a and b.
OR Logical OR a OR b The result is the logical OR of BOOL variables a and b.
XOR Exclusive OR a XOR b The result is the logical exclusive OR of BOOL variables a and
b.
NOT NOT NOT a The result is the NOT of BOOL variable a.