beautypg.com

2 subprograms, Operating sequence, Programming notes – HEIDENHAIN TNC 410 ISO Programming User Manual

Page 343: Programming a subprogram, Calling a subprogram, 2 sub p rogr ams 9.2 subprograms

background image

HEIDENHAIN TNC 410, TNC 426, TNC 430

317

9.2 Sub

p

rogr

ams

9.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

n

A main program can contain up to 254 subprograms.

n

You can call subprograms in any sequence and as often as desired.

n

A subprogram cannot call itself.

n

Write subprograms at the end of the main program (behind the block
with M2 or M30).

n

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

U

U

U

U

To mark the beginning, select the function G98 and

confirm with the ENT key.

U

U

U

U

Enter the subprogram number and confirm with the

END key.

U

U

U

U

To mark the end, select the function G98 and enter the

label number “0”.

Calling a subprogram

U

U

U

U

To call a subprogram, press the L key.

U

U

U

U

Enter the label number for the subprogram you are

calling and “.0”.

% ...

L1,0

G00 Z+100 M2
G98 L1 *

G98 L0 *
N99999 % ...

98

L0.0

is not permitted, as it corresponds to the program

end call.