Main program as subprogram -8, 3 main program as subprogram – HEIDENHAIN TNC 360 ISO Programming User Manual
Page 131

6
Subprograms and Program Section Repeats
TNC 360
6-8
Fig. 6.3:
Flow diagram of a main program as subprogram;
S
= jump,
R
= return jump
R
S
% A ... *
% B *
N9999
% A ... *
1
3
% B ... *
N9999
% B — *
2
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
0
/
0
6.3 Main Program as Subprogram
Principle
A program is executed until another program is
called (block with %) (
1
).
The called program is executed from beginning to
end (
2
).
Execution of the program from which the other
program was called is then resumed with the block
following the program call (
3
).
Operating limits
• Programs called from an external data storage
medium must not contain any subprograms or
program section repeats.
• No labels are needed to call main programs as
subprograms.
• The called program must not contain the miscel-
laneous functions M2 or M30.
• The called program must not contain a jump into
the calling program.
To call a main program as a subprogram
PROGRAM NAME?
Enter the main program call and the name of the program you want to call.
Resulting NC block: % NAME
A main program can also be called with cycle G39 (see page 8-38).