Mitsubishi Electric MELSEC Q Series Structured Programming Manual page 89

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

Advertisement

(6) FOR...DO syntax
(a) Format
FOR <Repeat variable initialization>
TO <Last value>
BY <Incremental expression> DO
<Syntax ...>;
END_FOR;
(b) Description
The FOR...DO syntax repeats the execution of several syntax according to the value of
a repeat variable.
(c) Example
(7) WHILE...DO syntax
(a) Format
WHILE <Boolean expression> DO
<Syntax ...>;
END_WHILE;
(b) Description
The WHILE...DO syntax executes one or more syntax while the value of Boolean
expression (conditional expression) is TRUE.
The Boolean expression is evaluated before the execution of the syntax. If the value of
Boolean expression is FALSE, the syntax in the WHILE...DO syntax is not executed.
Since a return result of the Boolean expression in the WHILE syntax requires only
TRUE or FALSE, any Boolean expression that can be specified in the IF conditional
syntax can be used.
(c) Example
5.1 ST
5.1.3 Syntax in ST language
5
5-7

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l seriesMelsec-f

Table of Contents