beautypg.com

HEIDENHAIN TNC 407 (280 580) User Manual User Manual

Page 195

background image

TNC 425/TNC 415 B/TNC 407

7-10

7

Programming with Q Parameters

7.4

If-Then Decisions with Q Parameters

Overview

FN9: IF EQUAL, JUMP
e.g. FN9: IF +Q1 EQU +Q3 GOTO LBL 5
If the two values or parameters are equal,
jump to the given label.

FN10: IF NOT EQUAL, JUMP
e.g. FN10: IF +10 NE –Q5 GOTO LBL 10
If the two values or parameters are unequal,
jump to the given label.

FN11: IF GREATER THAN, JUMP
e.g. FN11: IF+Q1 GT+10 GOTO LBL 5
If the first value or parameter is greater
than the second value or parameter,
jump to the given label.

FN12: IF LESS THAN, JUMP
e.g. FN12: IF+Q5 LT+0 GOTO LBL 1
If the first value or parameter is less
than the second value or parameter,
jump to the given label.

Jump example

You want to jump to program 100.H as soon as Q5 becomes negative.

5

FN0: Q5 = +10 ................................................... Assign a value, e.g. +10, to parameter Q5

9

FN 2: Q5 = +Q5 – +12 ....................................... Make Q5 smaller

10

FN 12: IF +Q5 LT +0 GOTO LBL 5 ..................... Jump to label 5, if +Q5 < 0

15

LBL 5 .................................................................. Label 5

16

PGM CALL 100 ................................................... Jump to program 100.H

.
.
.

.
.
.

.
.
.

.
.
.

Soft key