beautypg.com

Repeating subprograms – HEIDENHAIN TNC 360 User Manual User Manual

Page 135

background image

TNC 360

6-12

6

Subprograms and Program Section Repeats

6.4

Nesting

.
.
.

.
.
.

.
.
.

Repeating subprograms

Program layout

0

BEGIN PGM 3600612 MM

e.g. 10

LBL 1

11

CALL LBL 2 ............................................... Subprogram call

12

CALL LBL 1 REP 2/2

..... Program section repeat

e.g. 19

L Z+100 R0 FMAX M2 .............................. Last program block of main program with M2

20

LBL 2 ......................................................... Beginning of subprogram

e.g. 28

LBL 0 ......................................................... End of subprogram

29

END PGM 3600612 MM ........................... End of main program

Sequence of program execution

Step 1:

Main program 3600612 is executed to block 11.

Step 2:

Subprogram 2 is called and executed.

Step 3:

Program section between block 12 and block 10 is repeated
twice: subprogram 2 is repeated twice.

Step 4:

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

5

1

2

2x

3

4