Programming manual
486
CNC 8070
15.
STATEMENTS AND INSTRUCTIONS
Flow controlling instructions
(SOFT V02.0X)
482
$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.
$IF <condition1>... $ELSEIF<condition2>... $ENDIF
This instruction analyzes the following programmed conditions.
• If <condition1> is true, it executes the blocks contained between
$IF and $ELSEIF.
• If <condition1> is false, it analyzes <condition2>. If true, it executes
the blocks contained between $ELSEIF and $ENDIF (or the next
$ELSEIF if any).
• If all the conditions are false, the execution continues at the block
after $ENDIF.
As many $ELSEIF instructions as necessary may be programmed.
An $ELSE instruction may also be included. In this case, if all the
conditions are false, it will execute the blocks contained between
$ELSE and $ENDIF.
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.
N20 $IF P1==1
N30...
N40...
N50 $ELSEIF P2==[-5]
N60...
N70 $ELSE
N80...
N90 $ENDIF
N100 ...
• If P1 is equal to 1, it will execute blocks N30 through N40. The execution
continues at N100.
• If P1 is other than 1 and P2 is equal to -5, it executes block N60. The
execution continues at N100.
• If P1 is other than 1 and P2 is other than -5, it executes block N80 and
the execution continues at N100.