ASIN and ACOS functions are not available on 0/16/18/21 model controls !

#5 = ATAN[025]/[05]

265650512 (note the position of the slash !!!)

ASIN and ACOS functions are not available on 0/16/18/21 model controls !

Rounding Functions

Cal cu la tions of ten re sult in a value with too many dec i mal places In CNC work, only three dec –

i mal places can be used for met ric units, or four dec i mal places for Eng lish units in the pro steel punch gram or

a macro Some round ing is nec es sary and should be ex pected There are three func tions avail able

in mac ros that con trol the rounded value of a given num ber – they are sim i lar to each other, but

def i nitely not the same:


The ROUND func tion is de signed to round off the sup plied value to a whole num ber (round off

frac tions un der 10) The func tion dis re gards frac tions that are less than 05 For frac tions that are

equal to or greater than 05, the next whole num ber is the rounded value:


Returns 00


Returns 10


Returns 10


Returns 10

A value that had been stored hole punching machine pre vi ously into a vari able, can be rounded in the same way as a di –

rectly input value:

#1 = 13

Returns 13

#2 = 16

Returns 16


Returns 10


Returns 20

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

FANUC CNC Custom Macros


Chapter 9

There are small dif fer ences in us age of the ROUND func tion, de pend ing on ap pli ca tion If the

ROUND func tion is used in a def i ni tion of a vari able, the round ing ef fect will al ways be to the

near est in te ger value For ex am ple:

#101 = 19/64

Returns 0296875

#102 = ROUND[#101]

Returns 00

The ROUND func tion may also be used in a CNC state ment First, store a value:

#101 = 19/64

Returns 0296875

In the Eng lish sys tem of units, the small est unit in cre ment is 00001 of an inch, so the round ing

will be to the four dec i mal place ac cu racy (also known as drilling tools round ing to the least in cre ment) In a

CNC state ment, the round ing will be ac cu rate to 4-dec i mal places:

You can leave a response, or trackback from your own site.

Leave a Reply

Sorry, no posts matched your criteria.