beautypg.com

13 index-register – HEIDENHAIN TNC 407 (243 020) Technical Manual User Manual

Page 573

background image


7-112

TNC 407/TNC 415/TNC 425

3 Commands

01.98

3.13 INDEX-Register

Under the control of the PLC programmer this register can be used for data transfer, intermediate
storage of results and for index addressing of operands. The register is 32 bits wide but only the
lower 16 bits are used for index addressing. The X register can be used anywhere in the program –
there is no contents validity check – however there is a check for address space overflow with
indexed write accesses.

Example: =

B100[X]

X can assume values from -100 to +923 which corresponds to addressing the complete available
address space for the Byte operand type. If the address space is overshot the error message
"ERROR IN PLC PROGRAM 56" flashes in the display. Reset with END to display the error line in the
PLC Editor.

Before using a command with the index-register it must be assigned a defined value. At the
beginning of each PLC cycle the index register is set to 0.

The following operands can be addressed.

Mn[X]
In[X]
On[X]
Cn[X]
Tn[X]

Operand number = n+X

Bn[X]

Operand number = n+X

Wn[X]

Operand number = n+2*X

Dn[X]

Operand number = n+4*X

Sn[X]

String number = n+X

S#Dn[X]

Dialogue text number = n+X

S#En[X]

Error text number = n+X

Sn^X

Substring from X-th characters of n-th string

The types S"", K and K$ cannot be indexed.
Caution: When addressing S#Dn[X] and S#En[X] the sequence Dnnn or Ennn is
loaded in the string accumulator, with nnn as the modified string number!