Posts Tagged ‘ROUND6’

The third step will di vide the rounded value by the same multiplying factor

#6 = ROUND[#6]


Returns 139750


(based on the result of Step 1)


STEP 3 – The third step will di vide the rounded value by the same multiplying factor as be fore:


#5 = #5/1000


Returns 1398


(based on the result of Step 2)


#6 = #6/10000


Returns 13975


(based on the result of Step 2)


In the macro pro gram, the three steps can be used as de scribed, but a more com mon method is


to pro cess cnc cutter all three func tions in one nested state ment:


#4 = 1397528


Value to be rounded to a specific number of decimal places


#5 = ROUND[#4*1000]/1000


Returns 1398


#6 = ROUND[#4*10000]/10000


Returns 13975


Ac cu racy in round ing is ex Busway Press Clamp Machine tremely im por tant, not only for the fi nal di men sions of the ma chined


part, but also for track ing er rors in the macro pro gram Inaccuracies hole punching machine caused by cu mu la tive round –


ing er ror are not al ways easy to find


Al ways use care in pro gram ming rounded val ues


FUP and FIX Functions


The re main ing two round ing func tions are used to round a given value up or down only, re gard –


less of whether the dec i mal por tion is over or un der 05


The FUP func tion is de signed to round up the given value (raise frac tions less than 10)


FUP[000001]


Returns 10


FUP[05]


Returns 10


FUP[099999]


Returns 10


FUP[10]


Returns 10


The FIX func tion is de signed to round down the given value (dis card frac tions less than 10) –


ie, strip all val ues af ter dec i mal point


FIX[000001]


Returns 00


FIX[05]


Returns 00


FIX[099999]


Returns 00


FIX[10]


Returns 10


The FUP and FIX func tion are commonly used in es tab lish ing the num ber of it er a tions (count –


ing loops) and for other count ing (rather than cal cu lat ing) pur poses


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


FANUC CNC Custom Macros


122


Chapter 9


Miscellaneous Functions


Five macro ori ented mis cel la neous func tions are avail able for programming macro expressions


The fol low ing five func tions are avail able:


SQRT ABS LN EXP ADP


Do not con fuse these macro func tions with C