beautypg.com

Program section repeats, Principle, Programming notes – HEIDENHAIN TNC 360 User Manual User Manual

Page 128: Programming and calling a program section repeat

background image

6-5

TNC 360

6

Subprograms and Program Section Repeats

e.g.

e.g.

e.g.

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

As with subprograms, program section repeats are
marked with labels.

Principle

The program is executed up to the end of the
labelled program section (block with CALL LBL) (

1

,

2

).

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 resumed
(

5

).

Programming notes

• A program section can be repeated up to 65 534

times in succession.

• The number behind the slash after REP indicates

the number of remaining repetitions.

• The total number of times the program section

will be carried out is always one more than the
programmed number of repetitions.

LBL

CALL

LBL
SET

Programming and calling a program section repeat

Mark the beginning:

LABEL NUMBER?

Repeat the program section beginning with LABEL 7.

Resulting NC block: LBL 7

Number of repetitions

Enter the number of repetitions in the block which calls the label. This
block also identifies the end of the program section.

LABEL NUMBER?

Execute the program section beginning with LABEL 7.

REPEAT REP?

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

Resulting NC block: CALL LBL 7 REP 10/10

7

ENT

7

ENT

0

1

ENT

Fig. 6.2:

Flow diagram with program section repeats,

R

= return

jump