Fanuc Series 15i/150i-MA (Programming) Operators Manual B-63324EN/03 PROGRAMMING 17.CUSTOM MACRO
- 615 -
17.3 ARITHMETIC COMMANDS
A variety of arithmetic operations can be performed on variables. An
arithmetic command must be specified the same as in general
arithmetic expressions.
<Formula>
<Formula>, the right-hand-side of an arithmetic command is a
combination of constants, variables, functions and operators. A
constant can be used instead of #i, #j, and #k. A constant without a
decimal point used in <Formula> is considered to have a decimal point
at the end.
Table17.3 (a) Operation Commands
Operation type Operation
command
Description
(1)Definition,
replacement
#i=#j Definition or replacement of a variable
operation
#i=#j+#k
#i=#j-#k
#i=#j OR #k
#i=#j XOR #k
Subtraction
Logical OR. (Each pair of bits is handled separately,
each argument being 32 bits in length.)
Exclusive-OR. (Each pair of bits is handled separately,
each argument being 32 bits in length.)
(3)Multiplication
operation
#i=#j*#k
#i=#j/#k
#i=#j AND #k
#i=#j MOD #k
Multiplication
Division
Logical AND. (Each pair of bits is handled separately,
each argument being 32 bits in length.)
Remaindering. (The remainder is determined after #j
and #k are rounded to integers. If #j is negative, #i is
also negative.)
CFunction
#i=SIN[#j]
#i=COS[#j]
#i=TAN[#j]
#i=ASIN[#j]
#i=ACOS[#j]
#i=ATAN[#j]
#i=ATAN[#j]/[#k]
#i=ATAN[#j,#k]
#i=SQRT[#j]
#i=ABS[#j]
#i=BIN[#j]
#i=BCD[#j]
#i=ROUND[#j]
#i=FIX[#j]
#i=FUP[#j]
#i=LN[#j]
#i=EXP[#j]
#i=POW[#j,#k]
Sine (angle in degrees)
Cosine (angle in degrees)
Tangent (angle in degrees)
Arcsine
Arccosine
Arctangent (one argument). Can be shortened to ATN.
Arctangent (two arguments). Can be shortened to ATN.
Same as above.
Square root. Can be shortened to SQR.
Absolute value
Convert from BCD to BINNARY
Convert from BINARY to BCD
Rounding. Can be shortened to RND.
Rounding off to an integer
Rounding up to an integer
Natural logarithms
Exponentiate e (2.718...).
Exponentiation (#j to the #k-th power) 