Programming manual.
CNC 8070
22.
STATEMENTS AND INSTRUCTIONS
Flow controlling instructions
·434·
(REF: 1709)
22.2.2 Conditional execution ($IF)
$IF <CONDITION> ... $ENDIF
The following parameter is defined in this instruction:
This instruction analyzes the programmed condition.
• If the condition is true, it executes the blocks contained between the $IF and $ENDIF
instruction.
• If the condition is false, the execution continues at the block after $ENDIF.
The $IF instruction always ends with a $ENDIF, except when adding a $GOTO instruction,
in which case, it must NOT be programmed.
As an option, the $ELSE and $ELSEIF instructions may be inserted between $IF and
$ENDIF.
$IF <CONDITION> ... $ELSE ... $ENDIF
This instruction analyzes the programmed condition.
• If the condition is true, it executes the blocks contained between $IF and $ELSE and the
execution continues at the block after $ENDIF.
• If the condition is false, it executes the blocks contained between $ELSE and $ENDIF.
<condition> It may be a comparison between two numbers, parameters or arithmetic
expressions whose result is a number.
...
N20 $IF P1==1
N30...
N40...
N50 $ENDIF
N60 ...
If P1 is equal to 1, it will execute blocks N30 through N40.
If P1 is other than 1, the execution continues at N60.
...
N20 $IF P1==1 $GOTO N40
N30...
N40: ...
N50...
If P1 is equal to 1, the execution continues at block N40.
If P1 is other than 1, the execution continues at N30.
N20 $IF P1==1
N30...
N40...
N50 $ELSE
N60...
N70...
N80 $ENDIF
N90 ...
If P1 is equal to 1, it will execute blocks N30 through N40. The execution continues at N90.
If P1 other than 1, the execution continues at N50.