6. COMMAND REFERENCE 139

IF Test condition
Syntax aIF(system_variable,relation,value)
Description The IF command compares the specified system variable with the specified
value using the specified relation. If the condition is met, the next line of
code is executed otherwise it is skipped.
Refer to the table of system variables that can be used for conditional
control.
Valid relations for the comparison are:
=Equals
<> Does not equal
>Greater than
<Less than
Properties Immediate or buffered, can be used in labelled block, not saved by SV
Example 2IF(PA,>,450) ; if absolute controller position > 450 steps on axis 2
2O(1XX) ; set output 1
2IF(PA,>,500) ; if absolute controller position > 500 steps
2O(X1X) ; set output 2
Using inputs
2IF(IN,<>,1X00X) ; if input does not match the pattern
2O(XX1) ; set output 3
Note If you wish to use the IF command during motion, command queuing (system
variable CQ) must be set for continuous execution (CQ=0).