beautypg.com

Repeating subprograms -12 – HEIDENHAIN TNC 407 (280 580) ISO Programming User Manual

Page 190

background image

TNC 426/TNC 425/TNC 415 B/TNC 407

6-12

6

Subprograms and Program Section Repeats

6.4

Nesting

Repeating subprograms

Program structure

% UPGREP G71 *

e.g.

N10

G98 L1 *

N11

L2,0 * ................................................... Call subprogram

N12

L1,2 * ................................................... Program section repeat

e.g.

N19

G00 G40 Z+100 M2 * .......................... Last program block of main program with M2

N20

G98 L2 * .............................................. Start of subprogram

e.g.

N28

G98 L0 * .............................................. End of subprogram

N99999

% UPGREP G71 * ............................... End of main program

Program execution

1st step:

Main program UPGREP is executed up to block 11.

2nd step: Subprogram 2 is called and executed.

3rd step:

Program section from block 12 to block 10 is repeated twice,
so subprogram 2 is repeated twice.

4th step:

Main program UPGREP is executed from block 13 to block 19. End of program.

5

2

2x

3

4

1

.
.
.

.
.
.

.
.
.