# Fanuc Power Mate i-D/H Operator Manual PROGRAMMING
(Common to Power Mate i–D and –H)
13. CUSTOM MACRO
B–63174EN/03
116
The operations listed in Table 13.3 (a) can be performed on variables. The
expression to the right of the operator can contain constants and/or
variables combined by a function or operator. Variables #j and #K in an
expression can be replaced with a constant. Variables on the left can also
be replaced with an expression.
Table 13.3 (a) Arithmetic and logic operation
Function
Format Remarks
Definition #i=#j
Sum
Difference
Product
Quotient
#i=#j+#k;
#i=#j–#k;
#i=#j*#k;
#i=#j/#k;
Sine
Arcsine
Cosine
Arccosine
Tangent
Arctangent
#i=SIN[#j];
#i=ASIN[#j];
#i=COS[#j];
#i=ACOS[#j];
#i=TAN[#j];
#i=ATAN[#j]/[#k];
An angle is specified in de-
grees. 90 degrees and 30
minutes is represented as
90.5 degrees.
Square root
Absolute value
Rounding off
Rounding down
Rounding up
Natural logarithm
Exponential function
#i=SQRT[#j];
#i=ABS[#j];
#i=ROUND[#j];
#i=FIX[#j];
#i=FUP[#j];
#i=LN[#j];
#i=EXP[#j];
OR
XOR
AND
#i=#j OR #k;
#i=#j XOR #k;
#i=#j AND #k;
A logical operation is per-
formed on binary numbers
bit by bit.
Conversion from BCD to BIN
Conversion from BIN to BCD
#i=BIN[#j];
#i=BCD[#j];
Used for signal exchange
to and from the PMC
The units of angles used with the SIN, COS, TAN, ASIN, ACOS, and
ATAN functions are degrees. For example, 90 degrees and 30 minutes is
represented as 90.5 degrees.
The solution ranges are as indicated below:
When the bit 0 (NAT) of parameter 6004 is set to 0: 270 to 90
When the bit 0 (NAT) of parameter 6004 is set to 1: –90 to 90
When #j is beyond the range of –1 to 1, P/S alarm No.111 is issued.
A constant can be used instead of the #j variable.
The solution ranges from 180° to 0°.
When #j is beyond the range of –1 to 1, P/S alarm No.111 is issued.
A constant can be used instead of the #j variable.
13.3
ARITHMETIC AND
LOGIC OPERATION
Explanations
Angle units
ARCSIN #i = ASIN[#j];
ARCCOS #i = ACOS[#j]; 