User guide

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 IFXX command executed, the program proceeds to
the step following the corresponding EDIF.
Up to 15 levels of nesting are available when ISXX and DWXX are combined.
2-6 Structured IF Command
IFXX (Structured IF)
IFXX
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.
Expansion
condition
(AND · OR)
Input
condition
(I/O · Flag)
Command
Post
(Output port · Flag)
Command Operand 1 Operand 2
Optional Optional IFXX Variable no. Data · Variable no.