beautypg.com

Principle – HEIDENHAIN TNC 407 (280 580) User Manual User Manual

Page 179

background image

6-5

TNC 425/TNC 415 B/TNC 407

6

Subprograms and Program Section Repeats

0

BEGIN PGM ...

LBL 1

CALL LBL 1 REP 2/2

END PGM ...

.
.
.
.
.
.
.
.
.
.
.
.

1

3

5

4

2

R

R

6.2 Program Section Repeats

Program section repeats, like subprograms, are
identified with labels.

Principle

The program is executed up to the end of the
labeled program section (

1

and

2

), i.e. up to the

block with CALL LBL.

Then the program section between the called LBL
and the label call is repeated the number of times
entered after REP in the CALL LBL command (

3

,

4

).

After the last repetition the program is then
continued (

5

).

Programming notes

• A program section can be repeated up to 65 534

times in succession.

• Behind the slash after REP the TNC counts the

number of repetitions yet to be run.

• Altogether, the program section is always

executed once more than the number of pro-
grammed repeats.

LBL

CALL

e.g.

7

0

1

e.g.

ENT

LBL
SET

e.g.

7

Programming and calling a program section repetition

Mark the beginning

LABEL NUMBER ?

Repeat the program section beginning with LABEL 7.

Resulting NC block: LBL 7

Call the label and specify the number or repetitions

Enter the number of desired repetitions in the block that calls the label.
This is also the block that ends the program section.

LABEL NUMBER ?

Execute the program section beginning with LABEL 7.

REPEAT REP ?

Repeat the program section from LABEL 7 to this block 10 times. The
labeled program section will therefore be executed a total of 11 times.

Resulting NC block: CALL LBL 7 REP 10/10

ENT

ENT

Fig. 6.2:

Flow diagram for a program section repeat;

R

= return jump