Subprograms and program section repeats, Working with subprograms, Working with program section repeats – HEIDENHAIN iTNC 530 (340 49x-03) Pilot User Manual
Page 41

Su
bp
rog
ra
m
s an
d p
rog
ra
m
se
c
ti
o
n re
p
e
a
ts
41
Subprograms and program section
repeats
Subprograms and program section repeats enable you to program a
machining sequence once and then run it as often as desired.
Working with Subprograms
1
The main program runs up to the subprogram call CALL LBL 1.
2
The subprogram—labeled with LBL 1—runs through to its end at
LBL 0.
3
The main program resumes.
It's good practice to place subprograms after the main program end (M2).
Working with Program Section Repeats
1
The main program runs up to the call for a section repeat CALL LBL 1
REP2.
2
The program section between LBL 1 and CALL LBL 1 REP2 is repeated
the number of times indicated with REP.
3
After the last repetition the main program resumes.
Answer the dialog prompt REP with the NO ENT key.
You cannot call CALL LBL0!
0 BEGIN PGM ...
CALL LBL1
L Z+100 M2
LBL1
LBL0
END PGM ...
Altogether, the program section is run once more than the
number of programmed repeats.
0 BEGIN PGM ...
LBL1
CALL LBL1 REP 2/2
END PGM ...