Constants Field; Program Structures - HEIDENHAIN TNC 415 Technical Manual

Hide thumbs Also See for TNC 415:
Table of Contents

Advertisement

3.17 Constants Field (KF)
The Constants Field data type can be used to access one of several constants defined in tabular
form, depending on the value of the Index Register X.
Addressing is with KF Name[X], where 'Name' is a jump label that identifies the beginning of the

Constants Field.

Constants Fields start with the label KFIELD Name followed by a random (not zero) number of
constants followed by the end label ENDK. Constants Fields may only be created when the program
has been previously terminated with an EM or JP instruction.
The name of the Constants Fields conforms to the rules for jump labels.
Example:
L
KF VALUESFIELD
= W0
EM
KFIELD VALUESFIELD
K+10
K+1
K$ABC
K-100000
ENDK
Access to Constants Fields is checked in the same way as write access to indexed operands. This is
why X may only assume positive values from 0 to "Length of Constants Field -1".

3.18 Program Structures

A program is split up into program sequences so as to make it clearer. To do this the programmer
uses jump labels (LBL) and conditional and unconditional jumps.
When structured instructions are used, the jump labels and jump commands are created by the
Compiler. Remember that internal jump labels are generated to implement these structured
commands, so the total number of available jump labels will be reduced accordingly. Structured
instructions can be nested to up to 16 levels but there must be no "interleaving".
Right:
IFT
...
WHILEF
...
ENDW
...
ENDI
Instructions IFT, IFF, WHILET, WHILEF, ENDW, UNTILT and UNTILF require a valid gating result in
the Logic Accumulator. They terminate the gating chain.
Instructions ELSE, ENDI and REPEAT require all gating chains to be terminated first.
01.98
TNC 407/TNC 415/TNC 425
;ACCESS TO VALUESFIELD WITH
VALUESFIELD[X]
;X=[0 TO 3]
ONE OF THE CONSTANTS IS
STORED
CONSTANT TO BE LOADED IF X=0
CONSTANT TO BE LOADED IF X=3
Wrong: IFT
...
WHILEF
...
END
...
ENDW
3 Commands
7-127

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tnc 425eTnc 415fTnc 407Tnc 415bTnc 425

Table of Contents