31 pr ogr amming v a ri ables – HEIDENHAIN SW 54843x-02 DIN Programming User Manual
Page 397

HEIDENHAIN MANUALplus 620, CNC PILOT 640
397
4.31 Pr
ogr
amming v
a
ri
ables
Definition of constants—CONST
Possibilities of defining constants:
Direct assignment of values
Internal interpreter information as constants
Assignment of names to the transfer variables of subprograms
Use the following internal information to define constants in the
CONST section.
Example: Main program
%abc.nc
CONST
_square_root2 = 1.414213 [direct value
assignment]
_square_root_2 = SQRT(2) [direct value
assignment]
_posx = __n0_x [internal information]
VAR
. . .
BLANK
N..
FINISHED PART
N..
MACHINING
N..
. . .
Example: Subprogram
%SP1.ncS
CONST
_start_x=__la [subprogram transfer value]
_posx = __n0_x [internal constant]
VAR
#_wo = #c1 [tool orientation]
MACHINING
N.. #_wo = #w0(WTL)
N.. G0 X(#_posx*2)
N.. G0 X#_start_x
. . .
Internal information for defining constants
__n0_x
768 Last programmed position X
__n0_y
769 Last programmed position Y
__n0_z
770 Last programmed position Z
__n0_c
771 Last programmed position C
__n40_g
774 Status of TRC
__n148_o
776 Active wear compensation
__n18_g
778 Active working plane
__n120_x
787 Reference diameter X for calculating CY
__n52_g
790 Oversize G52_Geo taken into account 0=no /
1=yes
__n57_x
791 Oversize in X
__n57_z
792 Oversize in Z
__n58_p
793 Equidistant oversize
__n150_x
794 Cutting width shifted in X by G150/G151
__n150_z
795 Cutting width shifted in Z by G150/G151
__n95_g
799 Programmed feed type _G93/G94/G95)
__n95_q
796 Spindle number of the programmed feed rate
__n95_f
800 Last programmed feed rate
__n97_g
Programmed speed type _G96/G97)
__n97_q
797 Spindle number of the programmed speed type
__n97_s
Last programmed speed
__la-__z
Subprogram transfer values
The constant "_pi" is predefined to the value
3.1415926535989 and can be used directly in every NC
program.