Const code, Var code – HEIDENHAIN SW 54843x-02 DIN Programming User Manual
Page 50

50
NC programming
1
.3 Pr
ogr
a
m section code
CONST code
In the CONST section of the program you define constants. You use
constants for the definition of a value.
You enter the value directly or you calculate it. If you use constants in
the calculation you must first define them.
The length of the constant name must not exceed 20 characters.
Lower case letters and numbers are allowed. Constants always begin
with an underscore: See "Expanded variable syntax CONST – VAR" on
page 396.
VAR code
In the VAR program section, you assign names (descriptive text) to
variables: See "Expanded variable syntax CONST – VAR" on page 396..
The length of the variable name must not exceed 20 characters. Lower
case letters and numbers are allowed. Variables always begin with "#".
Example: CONST
CONST
_nvr = 0
_sd=PARA("","CfgGlobalTechPara","safetyDis
tWorkpOut")
_nws = _sd-_nvr
. . .
BLANK
N 1 G20 X120 Z_nws K2
. . .
MACHINING
N 6 G0 X100+_sd
. . .
Example: VAR
VAR
#_inside_dm = #l2
#_length = #g3
. . .
BLANK
N 1 #_length=120
N 2 #_inside_dm=25
N 3 G20 X120 Z#_length+2 K2 I#_inside_dm
. . .
MACHINING
. . .