2 subprograms, Operating sequence, Programming notes – HEIDENHAIN iTNC 530 (340 49x-02) ISO programming User Manual
Page 469: Programming a subprogram, Calling a subprogram

HEIDENHAIN iTNC 530
469
1
0
.2 Subpr
ogr
a
ms
10.2 Subprograms
Operating sequence
1
The TNC executes the part program up to the block in which a
subprogram is called with LN.0. n can be any label number.
2
The subprogram is then executed from beginning to end. The
subprogram end is marked G98 L0.
3
The TNC then resumes the part program from the block after the
subprogram call LN.0.
Programming notes
A main program can contain up to 254 subprograms.
You can call subprograms in any sequence and as often as desired.
A subprogram cannot call itself.
Write subprograms at the end of the main program (behind the block
with M02 or M30).
If subprograms are located before the block with M02 or M30, they
will be executed at least once even if they are not called.
Programming a subprogram
8
To mark the beginning, press the LBL SET key.
8
Enter the subprogram number and confirm with the
END key. If you want to use a label name, press the
key ” to switch to text entry.
8
To mark the end, press the LBL SET key and enter the
label number 0.
Calling a subprogram
8
To call a subprogram, press the LBL CALL key.
8
Label number:
Enter the label number of the
subprogram to be called, then confirm with the ENT
key. If you want to use a label name, press the key ”
to switch to text entry.
8
Repeat REP:
Enter ".0", then confirm with the ENT key.
% ...
L1,0
G00 Z+100 M2
G98 L1 *
G98 L0 *
N99999 % ...
L0.0
is not permitted, as it corresponds to the program
end call.