Conditional interpretation
Similar to a precompiler-statement in the programming language C, parts of NC-program can be summarized in #IF-#ELSE-#ENDIF-constructs. The interpretation of these program parts can thus be controlled as a function of the arithmetic expression.
The conditional interpretation always begins with
#IF <expr>
and ends with
#ENDIF
The statement
#ELSE
is optional and serves to build up a branching also.
Notice | |
The condition in $IF-control-block is checked by verifying the mathematical expression for true or not true (TRUE and FALSE). To be able to use also decimal variables the jump condition is fulfilled (TRUE) if.. |
In the use of conditional interpretation, the following rules are valid:
- Only "/" may be programmed in front of #IF, #ELSE und #ENDIF. Block numbers are not allowed.
- Nested conditional interpretations are allowed. The nesting depth is firmly given.
- Invalid branches of conditional interpretations are not checked for syntax but completely skipped.
Programming example
#IF V.E.START_VALUE == TRUE
N100 F100
:
#ELSE
N200 F40
:
#ENDIF
N300
:
:
N999 M30