Main program as subprogram, Principle, Operating limits – HEIDENHAIN TNC 360 User Manual User Manual
Page 131: Calling a main program as a subprogram, 3 main program as subprogram

TNC 360
6-8
6
Subprograms and Program Section Repeats
PGM
CALL
.
.
.
.
.
.
.
.
0
BEGIN PGM B...
END PGM B...
.
.
.
.
.
.
.
.
1
3
2
0
BEGIN PGM A...
CALL PGM B
END PGM A...
S
6.3 Main Program as Subprogram
Principle
A program is executed until another program is
called (block with CALL PGM) (
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 CALL PGM block (
3
).
Operating limits
• Programs called from an external data storage
medium (such as a floppy disk) 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.
Calling a main program as a subprogram
PROGRAM NUMBER?
Enter the main program call and the number of the program you want to call.
Resulting NC block: CALL PGM NAME
A main program can also be called with Cycle 12 PGM CALL (see page 8-38).
R
Fig. 6.3:
Flow diagram of a main program as subprogram;
S
= jump,
R
= return jump