1
Flexible NC programming 04.00
1.12 Control structures
1
840D
NCU 571
840D
NCU 572
NCU 573
FM-NC 810D 840Di
ï›™
Siemens AG 2000. All rights reserved
1-58
SINUMERIK 840D/840Di/810D/FM-NC Programming Guide Advanced (PGA)
−
04.00 Edition
1.12 Control structures
Explanation
IF–ELSE–IFENDIF
Selection between 2 alternatives
LOOP–ENDLOOP
Endless loop
FOR–ENDFOR
Count loop
WHILE–ENDWHILE
Loop with condition at beginning of loop
REPEAT–UNTIL
Loop with condition at end of loop
Function
The control processes the NC blocks as standard in
the programmed sequence.
In addition to the program branches described in this
Chapter, these commands can be used to define
additional alternatives and program loops.
These commands enable the user to produce well-
structured and easily legible programs.
Sequence
1. IF–ELSE–ENDIF
An IF–ELSE–ENDIF block is used to select one of
two alternatives:
IF
(expression)
NC blocks
ELSE
NC blocks
ENDIF
If the value of the expression is TRUE, i.e. the
condition is fulfilled, then the next program block is
executed. If the condition is not fulfilled, then the
ELSE program branch is executed.
The ELSE branch can be omitted.