Galil Motion Control manc 18x 6 Page 112
DMC-18x6 Command Reference
104
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:
Optional command to be used only after IF command
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 is true
ENDIF
End of IF conditional statement