Mitsubishi Electric MELSEC Q Series Programming Manual page 58

Structured text
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

4 ST PROGRAM EXPRESSIONS
4 - 18
(3) REPEAT...UNTIL syntax
[Format]
REPEAT
<Statement ...>
UNTIL <Boolean expression>
END_REPEAT;
[Explanation]
The REPEAT ... UNTIL syntax executes one or more statements while the
Boolean expression (conditional expression) is FALSE.
The Boolean expression is judged after execution of the statement. If the
value is TRUE, the statement in REPEAT ... UNTIL is not executed.
Since the <Boolean expression> in the REPEAT syntax is only required to
return whether the result is true or false, all expressions that can be
specified in the <Boolean expression> in the IF conditional statement can
be used.
Execution statement
Conditional
expression
[Description example]
(a) When actual device is used in Boolean expression
REPEAT
D1 : = D1 + 1;
UNTIL D1 < 100
END_REPEAT;
(b) When operator is used in Boolean expression
REPEAT
W1 : = W0*W1 - D0;
UNTIL W0*W1 < 100
END_REPEAT;
FALSE
TRUE
(* Until D1 becomes less than 100
(* D1 is incremented by 1
(* Until W0*W1 becomes less than 100 *)
(* W0*W1 - D0 is
(* assigned to W1.
*)
*)
*)
*)
4 - 18

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents