sh di men sion of 123456 will be come 123456 in met ric units – def i nitely


not cor rect Pro vid ing the G20 or G21 units se lec tion com mand into the pro gram is al ways highly rec om mended What is def i nitely never rec om mended is to use both types of units in one pro –


gram, that is be tween the start of main pro gram and the M30 func tion for pro gram end


ALWAYS – pro vide units se lec tion in ev ery pro gram


NEVER – use both avail able units in any one program


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


FANUC CNC Custom Macros


CONCEPT OF VARIABLES


89


drilling Machine


Positive and Negative Variables


A vari able def i ni tion that is not equal to zero is called a non-zero vari able Non-zero vari ables


may be ex pressed as ei ther pos i tive or neg drilling machine a tive vari able values For ex am ple,


#24 = 137


this is a positive value variable definition


#25 = -52


this is a negative value variable definition


Why is this very sim ple and com mon fact so im drilling steel por tant? The rea son is that in a macro, the call


of the vari able may also be pos i tive or neg a tive, which means tow signs are in effect When the


vari able is ref er enced in the macro, the sign can be intentionally re versed, in or der to achieve the


op po site ef fect of the def i ni tion, for ex am ple:


G00 X-#24


will be equivalent to G00 X-137


G00 Y-#25


will be equivalent to G00 Y52


G00 X#24


will be equivalent to G00 X137


G00 Y#25


will be equivalent to G00 Y-52


The sign in the dec la ra tion is al ways used to gether with the sign in the ac tual ex e cu tion – the


same dec la ra tion used as above Look at one of the above ex am ples:


G00 Y-#25


will be equivalent to G00 Y52


The rea son is strictly math e mat i cal and re lates to the use of a dou ble sign in a cal cu la tion In


many in stances, a neg a tive num ber will have to be added or sub tracted, and so on


The fol low ing ex am ples drilling tools show all four pos si bil i ties: