While..endwhile program repeat, 35 conditional bloc k run – HEIDENHAIN CNC Pilot 4290 V7.1 User Manual

Page 323

Advertising
background image

HEIDENHAIN CNC PILOT 4290

323

4.35 Conditional Bloc

k Run

WHILE..ENDWHILE program repeat

A program repeat consists of the elements:

„

WHILE, followed by a condition. The condition includes a variable or
mathematical expression on either side of the relational operator.

„

ENDWHILE concludes the conditional program repeat.

NC blocks programmed between WHILE and ENDWHILE are
executed repeatedly for as long as the condition is fulfilled. If the
condition is not fulfilled, the CNC PILOT continues execution of the
program with the block programmed after ENDWHILE.

Programming:

U

Select “Instr. > DIN PLUS words” in the machining menu. The CNC
PILOT opens the “DIN PLUS words” selection list.

U

Select WHILE

U

Enter the condition

U

Insert NC blocks between WHILE and ENDWHILE.

V variables are included during simulation. The V variables can be
assigned values. Thus all branches of your NC program can be tested.

Relational operators

<

Less than

<=

Less or equal

<>

Not equal to

>

Greater than

>=

Greater than or equal

==

Equal

Combining conditions:

AND

Logical AND operation

OR

Logical OR operation

Example: WHILE..ENDWHILE

. . .

N.. WHILE (#4<10) AND (#5>=0)

N.. G0

Xi10

. . .

N.. ENDWHILE

. . .

„

You can combine up to two conditions.

„

If the repetition is made due to V variables or events, the
contour follow-up function is switched off for the WHILE
branch and switched on again with ENDWHILE. With
G702, G703 or G706 you control the contour follow-up.

„

If the condition you program in the WHILE command is
always true, the program remains in an endless loop.
This is one of the most frequent causes of error when
working with program repeats.

Advertising