While Loop Statement - Hitachi NT2021XA Instruction Manual

Easy-sequence programming software
Table of Contents

Advertisement

Chapter 2 Syntax
- Processing cycle
Refer to the statement execution sequence indicated by parenthesized numbers in the comment fields of the sample programs
below.
(1) :
The "for" line is executed only once.
(2) and (3) :
<instruction set>
(4) :
<variable>
executed. Then,
is executed). When repeating the loop, processing returns to the first instruction of
(5) :
This step is executed in the next cycle.
(6) to (10) :
These steps are repeated in the same way as the preceding loop execution.
(11) :
Processing proceeds to the following step (line).
- Sample program
Label
Mnemonic
for
Y(00)=
Y(00)=
next
Y(00)=

while loop statement

- Format
Format
while
<condition>
<instruction set>
wend
- Explanation
This instruction executes
before the execution of
executing
<instruction
- Sample program (Condition "X (00) = 0" is met after the loop is executed twice.)
Label
Mnemonic
while
Y(00)=
Y(00)=
wend
Y(00)=
is executed.
is incremented in the cycle that follows the cycle in which the last instruction of
<variable>
is checked to determine whether to exit the loop (in other words, the next statement
parameter1
parameter2
U(00)
0
1
0
1
Instruction to conditionally execute a pre-conditioned loop
This instruction executes
Note that
set>.
<instruction set>
repeatedly as long as
<instruction
set>. If
<condition>
set>.
Is
<condition>
Execute
parameter1
parameter2
X(00)
=
1
0
1
parameter3
parameter4
parameter5
3
1
Description
<instruction set>
<condition>
is checked before the execution of
<condition>
is not met, processing proceeds to the wend statement without
No
met?
Yes
<instruction set>
parameter3
parameter4
parameter5
1
2-12
<instruction set>
<instruction set>
Sequence of execution
(1)
(2)
(5)
(8)
(3)
(6)
(9)
(4)
(7)
(10)
(11)
while
<condition>
<instruction
is met. Note that
<condition>
Sequence of execution
(1)
(5)
(9)
(2)
(6)
(3)
(7)
(4)
(8)
(10)
is
in this cycle.
is met.
is checked

Advertisement

Table of Contents
loading

Table of Contents