Chapter 4. programming – IAI America S-SEL-E User Manual
Page 174
![background image](/manuals/350298/174/background.png)
Page 169
Chapter 4. Programming
[Function]
Compares the contents of the variable in Operand 1 and the value in Operand 2. When the condition is estab-
lished, the program proceeds to the next step.
When the condition is not established, if there is a corresponding ELSE command, the program proceeds to the
next step after that. If not, it proceeds to the next step after the corresponding EDIF command.
When the input condition is not established and there is no IF
XX
command executed, the program proceeds to
the step following the corresponding EDIF.
Up to 15 levels of nesting are available when IS
XX
and DW
XX
are combined.
2-6 Structured IF Command
IFXX (Structured IF)
IF
XX
EQ
· · ·
Operand 1 = Operand 2
NE
· · ·
Operand 1
≠
Operand 2
GT
· · ·
Operand 1 > Operand 2
GE
· · ·
Operand 1
≥
Operand 2
LT
· · ·
Operand 1 < Operand 2
LE
· · ·
Operand 1
≤
Operand 2
[Example]
600
IFEQ
1
1
Select axis
IFGE
2
0
Select moving direction
JFWN
01
5
Move Axis 1 forward
ELSE
JBWN 01
5
Move Axis 1 backward
EDIF
ELSE
IFNE
2
1
Select moving direction
JFWN
10
5
Move Axis 2 forward
ELSE
JBWN 10
5
Move Axis 2 backward
EDIF
EDIF
Variable 1 selects Axis 1 or Axis 2. Variable 2 selects forward or backward to jog.
When flag 600 is OFF, nothing is done and the program proceeds to the step after the last EDIF.
*Do not use GOTO (TAG) in between IFXX and EDIF.
E x p a n s io n
c o n d itio n
(A N D · O R )
In p u t
c o n d itio n
(I/O · F la g )
C o m m a n d
P o s t
(O u tp u t p o rt · F la g )
C o m m a n d
O p e ra n d 1
O p e ra n d 2
O p tio n a l
O p tio n a l
IF X X
Va ria b le n o .
D a ta · Va ria b le n o .