To correct the accumulative error, or if you want to be ab so lutely certain

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

FANUC CNC Custom Macros



To correct the accumulative error, or if you want to be ab so lutely certain, you have to round copper busbar bending machine the

mo tion in one di rec tion to equal to the mo tion in the op po site di rec tion:

N1 G20

English units input

N2 #100 = 3 + 19/64

Input value of 3296875

(motion A)

N3 #101 = 2 + 5/64

Input value of 2078125

(motion B)

N4 G91 G00 X-#100

Incremental motion A to the left X-32969

N5 G01 X-#101 F200

Incremental motion B to the left X-20781

N6 G00 X[ROUND[#100]+ROUND[#101]] Incremental motion A+B Busway Press Clamp Machine to the right will be rounded

N7 M00

End of drilling steel example

Rounding to a Fixed Number of Decimal Places

There are times when a frac tional value has to be rounded to a spe cific (fixed) num ber of dec i –

mal places Typ i cally, three dec i mal places are re quired for the met ric sys tem, four dec i mal

places are re quired for the Eng lish sys tem, and per haps one dec i mal place is re quired for cut ting

feedrate, re gard less of the units se lected

In the fol low ing two ex am ples, two given val ues will use a few techniques, pro vid ing the re sults

of dif fer ent round ing meth ods:

2 Example 1 – Given fractional value is over 05 :

#1 = 1638719

Value to be rounded to a specific number of decimal places

If the ROUND func tion is ap plied to this defined value, it will re turn the next whole num ber:


Returns 20

In or der to round the given value to a cer tain num ber of dec i mal places, the to tal of three steps

will be nec es sary

STEP 1 – The first step re quires the given value to be mul ti plied by the fac tor of:


to round off to one decimal place


to round off to two decimal places


to round off to three decimal places

typical for metric system


to round off to four decimal places

typical for English system

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

Leave a Reply

Sorry, no posts matched your criteria.