Chapter 2 Syntax
if statement
Instruction to branch processing unconditionally
- Format
Format
Description
if
<condition>
then
<label name>
When
<condition>
is met, processing branches to the step labeled with
<label name>
.
When
<condition>
is not met, processing proceeds to the next step (line).
- Explanation
Use this instruction to branch processing conditionally.
When
<condition>
is met, processing branches to the step labeled with
<label name>
described after “then.”
<condition>
: Specifies a conditional expression among those listed in Section 2.2, “ List of Instructions (2) Conditional
expressions.”
<label name>
: Specifies the label name of the branch-target step (line).
- Processing cycle
Note that
<condition>
check and branch processing are executed in the same cycle.
Refer to the statement execution sequence indicated by parenthesized numbers in the comment fields of the sample programs
below.
- Sample program
Label
Mnemonic
parameter1
parameter2
parameter3
parameter4
parameter5
㩷
㩷
Yw= 0
㩷
㩷
㩷
㩷
: Turn off terminals Y (00) to Y (05).
㩷
if X(00)
=
1
then
LABEL1
: (1) When <condition> is met, branch to
step "LABEL1."
㩷
if X(01)
=
1
then
LABEL2
: (2) When <condition> is met, branch to
step "LABEL2."
㩷
Y(00)= 1
㩷
㩷
㩷
㩷
: (3)
㩷
goto LABEL3
㩷
㩷
㩷
㩷
: (4)
(2)
LABEL1 Y(01)=
1
㩷
㩷
㩷
㩷
:
(3)
㩷
goto LABEL3
㩷
㩷
㩷
㩷
:
LABEL2 Y(02)=
1
㩷
㩷
㩷
㩷
:
(3)
LABEL3 Y(03)=
1
㩷
㩷
㩷
㩷
: (5)
(4)
(4)
2-10
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 ...