Block If Statement - Omron SCARA YRCX Series Programming Manual

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

Advertisement

47
IF
8
8
47.2
A
A
B
B
C
C
D
D
E
E
F
F
G
G
MEMO
H
H
I
I
J
J
K
K
L
L
M
M
8-76
8-76
Chapter 8 Robot Language Lists
Chapter 8 Robot Language Lists

Block IF statement

Format
IF conditional expression 1 THEN
command block 1
ELSEIF conditional expression 2 THEN
command block 2
ELSE
command block n
ENDIF
Explanation
If the condition specified by <conditional expression 1> is met (true), this statement
executes the instructions specified in <command block 1>, then jumps to the next
line after ENDIF.
When an ELSEIF statement is present and the condition specified by <conditional
expression 2> is met (true), the instructions specified in <command block 2> are
executed.
If all the conditions specified by the conditional expression are not met (false),
<command block n> is executed.
• When the conditional expression used to designate the IF statement condition is a numeric
expression, an expression value other than "0" indicates a TRUE status, and "0" indicates a
FALSE status.
SAMPLE
'MAIN ROUTINE
*ST:
MOVE P,P0,P1
IF DI(21,20)=1 THEN
DO(20)= 1
DELAY 100
WAIT DI(20)=0
ELSEIF DI(21,20)=2 THEN
DELAY 100
ELSE
GOTO *FIN
ENDIF
GOTO *ST
*FIN:
HALT

Advertisement

Table of Contents
loading

Table of Contents