Nesting -9, Nesting depth -9 subprogram in a subprogram -9, 4 nesting – HEIDENHAIN TNC 360 ISO Programming User Manual
Page 132

6
Subprograms and Program Section Repeats
6-9
TNC 360
.
.
.
.
.
.
.
.
.
.
.
.
3
4
2
5
1
.
.
.
Subprogram 1
with program call of
subprogram 2
Subprogram 2
6.4 Nesting
Subprograms and program section repeats can be nested in the following
variations:
• Subprograms in subprograms
• Program section repeats in program section repeats
• Subprograms can be repeated
• Program section repeats can appear in subprograms
Nesting depth
The nesting depth is the number of successive levels for which subpro-
grams or program sections can call further subprograms or program
section repeats.
Maximum nesting depth for subprograms: 8
Maximum nesting depth for calling main programs: 4
Subprogram in a subprogram
Program layout
% UPGMS G71 *
e.g. N17
L1,0 * ....................................................... Call of subprogram at G98 L1
e.g. N35
G00 G40 Z+100 M2 * .............................. Last program block of main program (with M2)
N36
G98 L1 *
e.g. N39
L2,0 *
e.g. N45
G98 L0 * ................................................... End of subprogram 1
N46
G98 L2 *
e.g. N62
G98 L0 * ................................................... End of subprogram 2
N9999
% UPGMS G71 * ..................................... End of main program
Sequence of program execution
Step 1:
Main program UPGMS is executed up to block 17.
Step 2:
Subprogram 1 is called and executed up to block 39.
Step 3:
Subprogram 2 is called and executed up to block 62.
End of subprogram 2 and return to the subprogram from
which it was called.
Step 4:
Subprogram 1 is executed from block 40 to block 45.
End of subprogram 1 and return to main program UPGMS.
Step 5:
Main program UPGMS is executed from block 18 to block 35.
Return jump to block 1 and program end.