HEIDENHAIN NC 124 User Manual
Page 94
8
Subprograms and Program Section Repeats
94
TNC 124
Subprograms and Program Section Repeats
Subprograms and program section repeats only need to be entered
once in the program. You can then run them up to 999 times.
Subprograms can be run at any point in the program, while program
section repeats are run several times in succession.
Inserting program marks (labels)
You identify subprograms and program section repeats with labels
(abbreviated in the program to LBL).
Labels 1 to 99
Labels 1 to 99 identify the beginning of a subprogram or a program
section which is to be repeated.
Label 0
Label 0 is used only to identify the end of a subprogram.
Label call
In the program, subprograms and program sections are called with
the command CALL LBL.
The command CALL LBL 0 is not allowed.
Subprograms:
After a CALL LBL block in the program, the TNC executes the
called subprogram.
Program section repeats:
The TNC repeats the program section located before the CALL LBL
block. You enter the number of repeats with the CALL LBL com-
mand.
Nesting program sections
Subprograms and program section repeats can also be nested. For
example, a subprogram can in turn call another subprogram.
Maximum nesting depth: 8 levels
8
Fig. 8.1:
On-screen operating instructions
for subprogram (page 5 shown)
Fig. 8.2:
On-screen operating instructions
for program section repeats
(page 3 shown)