Repeating a subprogram, 5 nesting – HEIDENHAIN TNC 320 (340 55x-05) ISO programming User Manual
Page 194
Advertising

194
Programming: Subprograms and Program Section Repeats
7.
5 Nesting
Repeating a subprogram
Example NC blocks
Program execution
1
Main program SUBPGREP is executed up to block 11.
2
Subprogram 2 is called and executed.
3
Program section between block 10 and block 12 is repeated twice.
Subprogram 2 is repeated twice.
4
Main program SUBPGREP is executed from block 13 to block 19.
End of program.
%SUBPGREP G71 *
...
N10 G98 L1 *
Beginning of program section repeat 1
N11 L2,0 *
Subprogram call
N12 L1,2 *
Program section between G98 L1 (block N10)
...
and this block is repeated twice
N19 G00 G40 Z+100 M2 *
Last block of the main program with M2
N20 G98 L2 *
Beginning of subprogram
...
N28 G98 L0 *
End of subprogram
N99999999 %SUBPGREP G71 *
Advertising