beautypg.com

6 if-then decisions with q parameters, Application, Unconditional jumps – HEIDENHAIN TNC 620 (340 56x-03) User Manual

Page 239: Programming if-then decisions

background image

HEIDENHAIN TNC 620

239

8.6 If-Then Decisions with Q

P

ar

amet

ers

8.6 If-Then Decisions with

Q Parameters

Application

The TNC can make logical If-Then decisions by comparing a
Q parameter with another Q parameter or with a numerical value. If
the condition is fulfilled, the TNC continues the program at the label
that is programmed after the condition (for information on labels, see
"Labeling Subprograms and Program Section Repeats", page 214
). If it
is not fulfilled, the TNC continues with the next block.

To call another program as a subprogram, enter a PGM CALL program
call after the block with the target label.

Unconditional jumps

An unconditional jump is programmed by entering a conditional jump
whose condition is always true. Example:

FN 9: IF+10 EQU+10 GOTO LBL1

Programming If-Then decisions

Press the JUMP soft key to call the If-Then conditions. The TNC then
displays the following soft keys:

Function

Soft key

FN 9

: IF EQUAL, JUMP

Example: FN 9: IF +Q1 EQU +Q3 GOTO LBL "UPCAN25"
If the two values or parameters are equal, jump to the
given label.

FN 10

: IF UNEQUAL, JUMP

Example: FN 10: IF +10 NE –Q5 GOTO LBL 10
If the two values or parameters are unequal, jump to
the given label.

FN 11

: IF GREATER, JUMP

Example: FN 11: IF+Q1 GT+10 GOTO LBL 5
If the first value or parameter is greater than the
second, jump to the given label.

FN 12

: IF LESS, JUMP

Example: FN 12: IF+Q5 LT+0 GOTO LBL "ANYNAME"
If the first value or parameter is less than the second,
jump to the given label.