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>
is executed.
(4) :
<variable>
is incremented in the cycle that follows the cycle in which the last instruction of
<instruction set>
is
executed. Then,
<variable>
is checked to determine whether to exit the loop (in other words, the next statement
is executed). When repeating the loop, processing returns to the first instruction of
<instruction set>
in this cycle.
(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
parameter1
parameter2
parameter3
parameter4
parameter5
Sequence of execution
㩷
for U(00)
0
3
1
㩷
䋺
(1)
㩷 㩷 㩷
㩷
Y(00)= 1
㩷
㩷
㩷
㩷
䋺
(2)
(5) (8)
㩷
Y(00)= 0
㩷
㩷
㩷
㩷
䋺
(3)
(6) (9)
㩷
next
㩷
㩷
㩷
㩷
㩷
䋺
(4)
(7) (10)
㩷
Y(00)= 1
㩷
㩷
㩷
㩷
䋺
(11)
while loop statement
Instruction to conditionally execute a pre-conditioned loop
- Format
Format
Description
while
<condition>
<instruction set>
wend
This instruction executes
<instruction set>
while
<condition>
is met.
Note that
<condition>
is checked before the execution of
<instruction
set>
.
- Explanation
This instruction executes
<instruction set>
repeatedly as long as
<condition>
is met. Note that
<condition>
is checked
before the execution of
<instruction set>
. If
<condition>
is not met, processing proceeds to the wend statement without
executing
<instruction set>
.
Is
<condition>
met?
Execute
<instruction set>
No
Yes
- Sample program
(Condition “X (00) = 0” is met after the loop is executed twice.)
Label
Mnemonic
parameter1
parameter2
parameter3
parameter4
parameter5
Sequence of execution
㩷
while X(00)
= 1
㩷
㩷
䋺
(1)
㩷 㩷 㩷
(5) (9)
㩷
Y(00)= 1
㩷
㩷
㩷
㩷
䋺
(2)
(6)
㩷
Y(00)= 0
㩷
㩷
㩷
㩷
䋺
(3)
(7)
㩷
wend
㩷
㩷
㩷
㩷
㩷
䋺
(4)
(8)
㩷
Y(00)= 1
㩷
㩷
㩷
㩷
䋺
(10)
2-12
Summary of Contents for NT2021XA
Page 4: ... Safety Instructions ...
Page 8: ... Contents ...
Page 10: ...Chapter 1 Outline of EzSQ ...
Page 14: ...1 4 Chapter 1 Outline of EzSQ ...
Page 16: ...Chapter 2 Syntax ...
Page 68: ...2 52 Chapter 2 Syntax ...
Page 70: ...Chapter 3 Interface with the Inverter ...
Page 80: ...3 10 Chapter 3 Interface with the Inverter ...