Simple If Statement - Omron SCARA YRCX Series Programming Manual

Robot controller
Hide thumbs Also See for SCARA YRCX Series:
Table of Contents

Advertisement

47
IF
Evaluates a conditional expression value, and executes the command in accordance with the conditions
47.1
Format
IF conditional expression THEN
Explanation
• When the conditional expression used to designate the IF statement condition is a numeric
MEMO
SAMPLE
'MAIN ROUTINE
*ST:
*L1:
*FIN:
HALT

Simple IF statement

If the condition specified by the <conditional expression> is met (true), processing
jumps either to the <label 1> which follows THEN, or to the next line after
<command statement 1> is executed.
If the condition specified by the <conditional expression> is not met (false), the
following processing occurs:
1. Processing either jumps to the <label 2> specified after the ELSE statement, or to
the next line after <command statement 2> is executed.
2. If nothing is specified after the ELSE statement, no action is taken, and processing
simply jumps to the next line.
expression, an expression value other than "0" indicates a TRUE status, and "0" indicates a
FALSE status.
MOVE P,P0,P1
IF DI(20)=1 THEN *L1 ········· If DI (20) is "1", a jump to *L1
DO(20)=1
DELAY 100
IF DI(21)=1 THEN *ST ELSE *FIN
····················· If DI (21) is "1", a jump to *ST
label 1
ELSE
command statement 1
occurs.
occurs. If other than "1", a jump to
*FIN occurs.
label 2
command statement 2
IF
8-75
8
A
B
C
D
E
F
G
H
I
J
K
L
M

Advertisement

Table of Contents
loading

Table of Contents