3 program section repeats, Label lbl, Operating sequence – HEIDENHAIN TNC 406 User Manual
Page 197: Programming notes, Programming a program section repeat

176
9 Programming: Subprograms and Program Section Repeats
9.3 Pr
ogr
am Section Repeats
9.3 Program Section Repeats
Label LBL
The beginning of a program section repeat is marked by the label LBL.
The end of a program section repeat is identified by CALL LBL /REP.
Operating sequence
1
The TNC executes the part program up to the end of the program
section (CALL LBL /REP).
2
Then the program section between the called LBL and the label
call is repeated the number of times entered after REP.
3
The TNC then resumes the part program after the last repetition.
Programming notes
You can repeat a program section up to 65 534 times in succession.
The number behind the slash after REP indicates the number of
repetitions remaining to be run.
The total number of times the program section is executed is always
one more than the programmed number of repeats.
Resetting the program repeat counters after an
interruption
If you interrupt program run during a program section repeat and then
restart, the TNC resets the program section repeat counters as
follows:
If you select a new program, the TNC resets all counters.
If you restart the same program with GOTO 0, the TNC resets the
counters in the current program.
If you do not return to the start of the program (GOTO > 0), the TNC
does not reset any counters.
Programming a program section repeat
8
To mark the beginning, press the LBL SET key and
enter a LABEL NUMBER for the program section you
wish to repeat.
8
Enter the program section.
0 BEGIN PGM ...
LBL1
CALL LBL1 REP 2/2
END PGM ...