ain val ues that can – and do – change

September 2, 2017 · Posted in Uncategorised · Comment 

ain val ues that can – and do – change

with each macro use For ex am ple, in stan dard pro gram ming, a macro may be used for re peat ing

the same toolpath for dif fer ent ma te ri als of the part Al though the toolpath it self may not change,

the spin dle speeds and the feedrates will be dif fer ent for each ma te rial For three ma te ri als, for ex –

am ple, three in di vid ual and sep a rate pro grams with many rep e ti tions would have to be writ ten

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

FANUC CNC Custom Macros



Quite likely, the only dif fer ence be tween Busway Press Clamp Machine the three pro grams will be the S-ad dress for spin dle

speed in rev/min and the F-ad dress for feedrate value in mm/min (in/min) With a macro, both ad –

dresses S and F can be de fined as vari ables (be cause they will change for each of the three ma te ri –

als), then sup ply the suit able speed and feedrate val ues for dif fer custom processing machine ent ma te ri als, as needed By

chang ing only those two val ues, the pro gram can be used for many more dif fer ent ma te ri als, not

just three The main pro gram ming ben e fit is that the body of the macro pro gram does not change

at all, once it is ver i fied

drilling Machine

Variable Declaration

Be fore they can be used, vari ables have to be de fined – macro ex pres sion re fers to this ac tiv ity

as dec la ra tion of vari ables – vari ables have to be de clared Just like the data en try into the mem ory of a cal cu la tor, the ba sic rules gov ern ing the dec la ra tion of vari ables is that a vari able must be de –

fined first, and only then it can be used in a pro gram or a macro In the pro gram that uses the vari –

able, the form of def i ni tion is rep re sented by the # sym drilling tools bol (com monly called the pound sign or the sharp sign or the num ber sign) This num ber sign will be used in all mac ros The def i ni tion of a

vari able can take sev eral forms, the first of them is the vari able value:

#i = assigned current value


where the let ter ‘i’ represents