3 program section repeats, Label lbl, Operating sequence – HEIDENHAIN TNC 128 (77184x-01) User Manual
Page 168: Programming notes, Programming a program section repeat, Calling a program section repeat

168
Programming: Subprograms and program section repeats
7.
3 Pr
ogr
a
m section r
e
peats
7.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 n REPn.
Operating sequence
1
The TNC executes the part program up to the end of the program
section (CALL LBL n REPn)
2
Then the program section between the called LBL and the label
call CALL LBL n REPn 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 total number of times the program section is executed is always
one more than the programmed number of repeats
Programming a program section repeat
To mark the beginning, press the LBL SET key and
enter a LABEL NUMBER for the program section you
wish to repeat. If you want to use a label name, press
the LBL NAME soft key to switch to text entry
Enter the program section
Calling a program section repeat
Press the LBL CALL key
To call subprograms/section repeats
: Enter the
label number of the subprogram to be called, then
confirm with the ENT key. If you want to use a label
name, press the " key to switch to text entry
Repeat REP
: Enter the number of repeats, then
confirm with the ENT key
0 BEGIN PGM ...
LBL1
CALL LBL 1 REP 2
END PGM ...
1
2
3
R
R
2/1
2/2