beautypg.com

Repeating a subprogram – HEIDENHAIN TNC 320 (34055x-06) User Manual

Page 230

background image

Programming: Subprograms and program section repeats

7.5

Nesting

7

230

TNC 320 | User's Manual HEIDENHAIN Conversational Programming | 5/2013

Repeating a subprogram

Example NC blocks

0 BEGIN PGM UPGREP MM
...
10 LBL 1

Beginning of program section repeat 1

11 CALL LBL 2

Subprogram call

12 CALL LBL 1 REP 2

The program section between LBL 1 and this block

...

(block 10) is repeated twice

19 L Z+100 R0 FMAX M2

Last block of the main program with M2

20 LBL 2

Beginning of subprogram

...
28 LBL 0

End of subprogram

29 END PGM UPGREP MM

Program execution

1 Main program UPGREP is executed up to block 11.

2 Subprogram 2 is called and executed.

3 Program section between block 12 and block 10 is repeated

twice. This means that subprogram 2 is repeated twice.

4 Main program UPGREP is executed from block 13 to block 19.

End of program.