the vari able num ber – for example:

September 2, 2017 · Posted in Uncategorised 

the vari able num ber – for example:

#19 = 1200

Value of 1200 is assigned to variable number 19

it can be spindle speed (rev/min)

#9 = 1500

Value of 1500 is assigned to variable number 9

it can be feedrate (mm/min, m/min, ft/min, in/min, etc)

These two macro state ments store val ues – the value of 1200 is stored into the vari able #19 and

the value of 1500 into the vari able #9 Both val ues shown in the ex am ple are num bers, but they

are two dif fer ent types of a num ber

Real Num bers and Integers

There are two ba sic types of nu merical val ues used in punch machine for Head macros – a num ber can be ei ther:


High Speed Drilling Machine

REAL number

real number always requires a decimal point


INTEGER number

integer numbers cannot use decimal point

When per form ing math e mat i cal cal cu la tions, the type of every nu mer i cal value is im por tant In sim ple drilling steel terms, real num bers are typ i cally used for cal cu la tions, whereby in te ger num bers are used

for count ing and other ap pli ca tions that do not re quire a dec i mal point When a vari able num ber is

used in the macro pro gram, its value can be changed as re quired at any time, two or more vari –

ables may be used for math e mat i cal cal cu la tions, etc

Copyright 2005, Industrial Press Inc, New York, NY – wwwindustrialpresscom

FANUC CNC Custom Macros


Chapter 7

Variable as an laser cutting Expression

Vari ables can also be de fined by us ing an ex pres sion, where the ex pres sion is typ i cally a math e –

mat i cal for mula or a gen eral cal cu la tion The sim plest ex pres sion is nor mally a di rect value as –

sign ment within the macro body, for ex am ple:

#9 = 2500

Vari able #9 in the ex am ple con tains an as signed value of 2500 mm This ac tual value may be

used to re place a vari able value in the macro, for ex am ple, the cut ting feedrate:

G01 X3750 F#9

The F#9 macro state ment will be in ter preted as F2500 (mm/min) ac tual state ment Re def i ni –

tion of the vari able, for ex am ple #9=3000, will pass on the new def i ni tion to the macro body, so


Leave a Reply