1 labeling subprograms and program section repeats, 2 subprograms – HEIDENHAIN TNC 310 (286 140) User Manual

Page 160

Advertising
background image

9 Programming: Subprograms and Program Section Repeats

148

9.1 Mar

king Subpr

ogr

ams and Pr

ogr

am Section Repeats;

9.2 Subprograms

9.1 Labeling Subprograms and

Program Section Repeats

Subprograms and program section repeats enable you to program a
machining sequence once and then run it as often as desired.

Labels
The beginnings of subprograms and program section repeats are
marked in a part program by labels.

A label is identified by a number between 1 and 254. Each label can
be set only once with LABEL SET in a program.

LABEL 0 (LBL 0) is used exclusively to mark the end of a
subprogram and can therefore be used as often as desired.

9.2 Subprograms

Operating sequence
1
The TNC executes the part program up to the block in which a

subprogram is called with CALL LBL.

2 The subprogram is then executed from beginning to end. The

subprogram end is marked with LBL 0.

3 The TNC then resumes the part program from the block after the

subprogram call.

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

0 BEGIN PGM ...

CALL LBL1

L Z+100 M2
LBL1

LBL0
END PGM ...

Advertising
This manual is related to the following products: