102 IF DMC-1400 Series Command Reference
IF
FUNCTION: IF conditional statement
DESCRIPTION:
The IF command is used in conjunction with an ENDIF command to form an IF conditional
statement. The arguments are one or more conditional statements. If the conditional
statement(s) evaluates true, the command interpreter will continue executing commands
which follow the IF command. If the conditional statement evaluates false, the controller
will ignore commands until the associated ENDIF command OR an ELSE command
occurs in the program.
ARGUMENTS: IF condition where
Conditions are tested with the following logical operators:
< less than or equal to
> greater than
= equal to
<= less than or equal to
>= greater than or equal to
<> not equal
USAGE:
While Moving Yes Default Value -
In a Program Yes Default Format -
Command Line No
Controller Usage DMC-1415/1416/1425
RELATED COMMANDS:
ELSE Optional command to be used only after IF command
ENDIF End of IF conditional Statement
EXAMPLES:
IF (_TEX<1000) IF conditional statement based on X motor position
MG "Motor is within 1000 counts of zero" Message to be executed if “IF” conditional statement
ENDIF End of IF conditional statement
IF(_TPX>5000)&(_TPY>5000)
IF conditional statement based on X and Y motor position
MG “Motors too Far” Message to be executed if “IF” statement is true
ENDIF End of IF statement