EasyManua.ls Logo

Hitachi SJ700-2 Series - If Statement

Hitachi SJ700-2 Series
134 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 5 Instruction Words
5 - 7
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 3.5, "Conditions," of
Chapter 3, "Syntax."
<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
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)

Table of Contents

Related product manuals