beautypg.com

Expanded variable syntax const – var, 31 pr ogr amming v a ri ables – HEIDENHAIN SW 548328-05 DIN Programming User Manual

Page 398

background image

398

DIN programming

4.31 Pr

ogr

amming v

a

ri

ables

Expanded variable syntax CONST – VAR

By defining the key words CONST or VAR, you can assign names to

variables. The key words can be used in the main program and

subprogram. To use the definitions in a subprogram, you need to

declare the constant or variable before the MACHINING section code.

Rules for defining constants and variables:

The names of constants and variables must be preceded by an

underscore. They can comprise lower case letters, numbers and the

underscore character. The maximum length must not exceed 20

characters.

Variable names with VAR
By assigning variable names, you make it easier to read an NC

program. To do this, you must insert the program section VAR. In this

program section, you assign the variable designations to the variables.

Example: Free-text variables

%abc.nc

VAR

#_rohdm=#l1 [#_rohdm is a synonym of #l1]

BLANK

N..

FINISHED PART

N..

MACHINING

N..

. . .

Example: Subprogram

%SP1.ncS

VAR

#_wo = #c1 [tool orientation]

MACHINING

N.. #_wo = #w0(WTL)

N.. G0 X(#_posx*2)

N.. G0 X#_start_x

. . .