MACRO FIX VS FUP VS ROUND
I often write code for Orthopaedic Taps and Screws. Quite a few of these have flutes running thru the threads as one would expect. As I set my macro for a family print of 6 or more sizes, one thing I need to consider is how to tackle the way my code handles roughing passes as diameters change and flute dimension moves in the Y axis. FIX, FUP, and ROUND allow me to handle this with relative ease.
FIX is not a rounding function, really. Any value after the decimal point is simply taken off. FIX[3.1] = 3. FIX[3.9] = 3. Regardless of the decimal point, it will be the same value.
FUP will round to the next whole number, away from 0. FUP[3.1] = 4. FUP[-3.1] = -4. This is very handy when coding rough passes. Take the total distance needed divided by your DOC and FUP will make sure your 1st pass isn't too heavy.
Round is exactly what we think it is. It is going to round to the next number, up or down. ROUND[3.1] = 3. ROUND[2.9] = 3. This can be dangerous if not handling it correctly. Some macros will end up taking heavier cuts than desired, unless adding more logic to prevent it.
This is what I am currently using in a Tap program. I have 6 Taps that have the Major ? and Radial Flute in Y change per size. Notice in #139 that I have a -1. at the end. If you do not do this, the 1st pass will be air. FUP calculates # of passes and rounds to next integer away from 0. So this will add an extra pass.
This is written for a Citizen M32 with a Mitsubishi control. It is set up with a radial Y axis. Feel free to ask any questions should you want to use it and get confused.