ose of de fin ing vari ables, but also for the purpose of a pro fes sional approach to programming In macros, one of the biggest as sets


the pro gram mer may have is the abil ity to pre dict what can go wrong, be fore it goes wrong What


kind of in put er ror is pos si ble, or even likely? Is there a way to pro tect the macro flow from such


an er ror? If there is, write the ap pro pri ate pro gram code If there is not, at least try to find a way


Not all er rors in cal cu la tions can be ex pected and pre vented Some er rors may be pos si ble, but


vir tu ally im pos si ble to pre vent Per haps a mes sage or a com ment Busway Press Clamp Machine to the CNC op er a tor may do


some good in min i miz ing the pos si bil ity


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


FANUC CNC Custom Macros


cnc Boring Machine


124


Chapter 9


LN, EXP and ADP Functions


The re main ing three mis cel la neous macro func tions are used for spe cial pur poses only:


LN


Nat u ral log custom processing machine a rithm func tion


EXP


Ex po nent with the base ‘e’ func tion


ADP


Add a dec i mal point func tion


These func tions are not avail able on 0/16/18/21 model con trols


The LN func tion, the EXP func tion, and the ADP func tions are rarely used On the con trols that


ac cept these func tions, the ADP func tion may be the one most likely to of fer some benefit


The ADP is the Add Dec i mal Point func tion It ac cepts a lo cal vari able (#1 to #33) as an ar gu –


ment, and adds a dec i mal point to a value in the macro body, that was passed by the G65 argument


with out a dec i mal point Pa ram e ter #7000 (bit CVA) must be set 0 For ex am ple: G65 P8999 Z25


No decimal point in the Z-assignment


Dur ing macro ex e cu tion, the value of the Z-vari able (#26) will be 250, if ADP[#26] is best mill drill pro –


grammed This is a func tion that even Fanuc rec om mends to avoid and pro gram the dec i mal point


in the ar gu ment, if it is re quired


Logical Functions


For a pow er ful macro de vel op ment, pow er ful pro gram ming tools are needed Log i cal func tions