Galil Motion Control optcom Page 112
Optima DMC-1xxx and DMC-18x2 Command Reference
IF
i
101
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 consist of one or more conditional statements and each
condition must be enclosed with parenthesis (). 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
Note:
Bit wise operators and & can be used to evaluate multiple conditions.
USAGE: DEFAULTS:
While Moving
Yes
Default Value
-
In a Program
Yes
Default Format
-
Command Line
No
Controller Usage
ALL CONTROLLERS
RELATED COMMANDS:
"ELSE"
Optional command to be used only after IF command
"ENDIF"
End of IF conditional Statement
EXAMPLES:
IF (_TEA<1000)
IF conditional statement based on A motor
position
MG "Motor is within 1000 counts of zero"
Message to be executed if "IF" conditional
statement
ENDIF
End of IF conditional statement