Arithmetic & Functions
Do trigonometry in a macro and know that Fanuc works in degrees.
Macro math uses square brackets, and trig is in degrees — not radians. COS[30] is 0.866, not what a calculator in radian mode would tell you.
Your turn
The machine hands you a radius in #101 and an angle in degrees in #120. Compute the point on the circle at that angle: #121 = the X distance, #122 = the Y distance.
The machine gives you
40 mm radius at 30°:
#101 = 40#120 = 3025 mm radius at 60°:
#101 = 25#120 = 60Your program is run once for each set of conditions. It has to work for all of them.
Loading...
This is a learning simulation — always prove out a program on the actual control before you cut metal.