beautypg.com

Enter program call in a program, Call, 3 main program as subprogram – HEIDENHAIN TNC 407 (280 580) User Manual User Manual

Page 182: Principle, Operating limits, Calling a main program as a subprogram

background image

TNC 425/TNC 415 B/TNC 407

6-8

6

Subprograms and Program Section Repeats

PGM

CALL

Fig. 6.3:

Flow diagram of a main program as subprogram;

S

= jump,

R

= return jump

.
.
.
.
.
.
.
.

0

BEGIN PGM B...

END PGM B...

.
.
.
.
.
.
.
.

1

3

2

R

0

BEGIN PGM A...

CALL PGM B

END PGM A...

S

6.3 Main Program as Subprogram

Principle

A program is executed (

1

) up to the block in

which another program is called.

Then the other program is run from beginning to
end (

2

).

The first program is then resumed beginning with
the block behind the program call (

3

).

Operating limits

• Programs called from an external data medium

(e.g., floppy disk) must not contain any subpro-
grams 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 NAME ?

Enter the name of the program that you wish to call from this block.

Function

Soft key

call a plain language program

call an ISO program

call an externally stored program

Resulting NC block: CALL PGM NAME

• You can also call a main program with cycle 12: PGM CALL (see page 8-53).
• If an ISO program is called, G50, G70 or G71 may not be part of the program name.