DMC-40x0 Command Reference
IF • 123
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:
#A
IF
(
_TE
A
<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
EN
;
'End Program
Содержание DMC-40x0 Series
Страница 2: ......
Страница 4: ......
Страница 10: ...vi i Table of Contents DMC 40x0 Command Reference This Page is Left Blank Intentionally ...