User's Manual TNC 360 (from 259 900-11) - heidenhain
User's Manual TNC 360 (from 259 900-11) - heidenhain
User's Manual TNC 360 (from 259 900-11) - heidenhain
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
6 Subprograms and Program Section Repeats<br />
6.4 Nesting<br />
Nesting depth<br />
<strong>TNC</strong> <strong>360</strong><br />
Subprograms and program section repeats can be nested in the following<br />
variations:<br />
• Subprograms in subprograms<br />
• Program section repeats in program section repeats<br />
• Subprograms can be repeated<br />
• Program section repeats can appear in subprograms<br />
The nesting depth is the number of successive levels for which subprograms<br />
or program sections can call further subprograms or program<br />
sections.<br />
Maximum nesting depth for subprograms: 8<br />
Maximum nesting depth for calling main programs: 4<br />
Subprogram in a subprogram<br />
Program layout<br />
0<br />
.<br />
BEGIN PGM <strong>360</strong>069 MM<br />
.<br />
.<br />
1<br />
e.g. 17<br />
.<br />
CALL LBL 1 .............................................. Call of subprogram at LBL1<br />
.<br />
.<br />
5<br />
e.g. 35 L Z+100 R0 FMAX M2 ............................. Last program block of main program (with M2)<br />
36<br />
.<br />
LBL 1<br />
.<br />
.<br />
2<br />
e.g. 39<br />
.<br />
CALL LBL 2<br />
.<br />
.<br />
4<br />
e.g. 45 LBL 0 ........................................................ End of subprogram 1<br />
46<br />
.<br />
LBL 2<br />
.<br />
.<br />
3<br />
e.g. 62 LBL 0 ........................................................ End of subprogram 2<br />
63 END PGM <strong>360</strong>069 MM ............................ End of main program<br />
Sequence of program execution<br />
Step 1: Main program <strong>360</strong>069 is executed up to block 17.<br />
Step 2: Subprogram 1 is called and executed up to block 39.<br />
Step 3: Subprogram 2 is called and executed up to block 62.<br />
End of subprogram 2 and return to subprogram <strong>from</strong><br />
which it was called.<br />
Step 4: Subprogram 1 is executed <strong>from</strong> block 40 to block 45.<br />
End of subprogram 1 and return to main program <strong>360</strong>069.<br />
Step 5: Main program <strong>360</strong>069 is executed <strong>from</strong> block 18 to block 35.<br />
Return jump to block 1 and program end.<br />
A subprogramm ending with LBL 0 must not be nested in another subprogram!<br />
Subprogram 1<br />
with program call of<br />
subprogram 2<br />
Subprogram 2<br />
6-9