# Fanuc Power Mate i-D/H Operator Manual

PROGRAMMING
(Common to Power Mate i–D and –H)
B–63174EN/03
13. CUSTOM MACRO
117
Specify the lengths of two sides, separated by a slash (/).
The solution ranges are as follows:
When the bit 0 (NAT) of parameter 6004 is set to 0: 0o to 360
[Example] When #1 = ATAN[–1]/[–1]; is specified, #1 is 225.0.
When the bit 0 (NAT) of parameter 6004 is set to 1: –180 to 180
[Example] When #1 = ATAN[–1]/[–1]; is specified, #1 is –135.0.0.
A constant can be used instead of the #j variable.
Note that the relative error may become 10
–8
or greater.
When the antilogarithm (#j) is zero or smaller, P/S alarm No.111 is
issued.
A constant can be used instead of the #j variable.
Note that the relative error may become 10
–8
or greater.
When the result of the operation exceeds 3.6510
47
an overflow occurs and P/S alarm No.111 is issued.
A constant can be used instead of the #j variable.
When the ROUND function is included in an arithmetic or logic
operation command, IF statement, or WHILE statement, the ROUND
function rounds off at the first decimal place.
Example:
When #1=ROUND[#2]; is executed where #2 holds 1.2345, the
value of variable #1 is 1.0.
When the ROUND function is used in NC statement addresses, the
ROUND function rounds off the specified value according to the least
Example:
Creation of a drilling program that cuts according to the values
of variables #1 and #2, then returns to the original position
Suppose that the increment system is 1/1000 mm, variable #1
holds 1.2345, and variable #2 holds 2.3456. Then,
G00 G91 X–#1; Moves 1.235 mm.
G01 X–#2 F300; Moves 2.346 mm.
G00 X[#1+#2];
Since 1.2345 + 2.3456 = 3.5801, the travel distance is 3.580,
which does not return the tool to the original position.
This difference comes from whether addition is performed before
or after rounding off. G00X–[ROUND[#1]+ROUND[#2]] must be
specified to return the tool to the original position.
ARCTAN #i =
ATAN[#j]/[#k];
Natural logarithm #i =
LN[#j];
Exponential function #i =
EXP[#j];
ROUND function