35 conditional block run, Program branching if..then..else..endif – HEIDENHAIN CNC Pilot 4290 V7.1 User Manual

Page 322

Advertising
background image

322

4.35 Conditional Bloc

k Run

4.35 Conditional Block Run

Program branching IF..THEN..ELSE..ENDIF

A conditional branch consists of the elements:

„

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

„

THEN. If the condition is fulfilled, the THEN branch is executed

„

ELSE. If the condition is not fulfilled, the ELSE branch is executed

„

ENDIF concludes the conditional program branch.

Programming:

U

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

U

Select IF

U

Enter the condition

U

Insert NC blocks of the THEN branch.

U

If required: Insert NC blocks of the ELSE branch.

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 for

<

Less than

<=

Less or equal

<>

Not equal

>

Greater than

>=

Greater than or equal

==

Equal

Combining conditions:

AND

Logical AND operation

OR

Logical OR operation

Example: IF..THEN..ELSE..ENDIF

. . .

N.. IF{E1[16]==1}

N.. THEN

N..

G0 X100 Z100

N.. ELSE

N..

G0 X0 Z0

N.. ENDIF

. . .

„

NC blocks with IF, THEN, ELSE, ENDIF can have no
further commands.

„

You can combine up to two conditions.

„

For branches due to V variables or events, the contour
follow-up is switched off with the IF statement and back
on with the ENDIF statement. With G702, G703 or G706
you control the contour follow-up.

Advertising