If Statement - Hitachi NT2021XA Instruction Manual

Easy-sequence programming software
Table of Contents

Advertisement

Chapter 2 Syntax

if statement

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

Advertisement

Table of Contents
loading

Table of Contents