ously defined variable is called by its number
o
Returned value
The new value that is the result of a calculation
o
Result of
Same as Returned value
o
Substitution
Storing new data in a previously defined variable, also known as redefinition
o
Redefinition
Same as Substitution
Many of these terms are used through out the hand book, and in many other pub li ca tions
Copyright 2005, cnc cutter Industrial Press Inc, New York, NY – wwwindustrialpresscom
FANUC CNC Custom Macros
MACRO FUNCTIONS
113
Arithmetic Functions
There are sev eral macro func tions re lat ing to math e mat i cal cal cu la tions The sim plest of them
are the four ba sic arith me tic func tions, used in vari ables and also avail able to the mac ros The
arith me tic func tions use the fol low ing sym bols:
+ – * /
Function
Known as 锟?
Symbol
Sum
Addition
+
Difference
Subtraction
–
Product
Multiplication
*
Quotient
Division
/
In or der to un der stand any func tion, it is im por tant to eval u ate a few ex am ples In the fol low ing
ex am ples, the func tion is on the left, its re turned value – the re sult – on the right:
#1 custom processing machine = 35
35
Returned value of variable #1 is 35
#2 = 425
425
Returned value of variable #2 is 425
#3 = 20 + 50
70
Returned value of variable #3 is a sum of 2+5
#4 = #3 + 1
80
Add 1 to the result of variable #3
#5 = #2 – 08
345
Subtract 08 from the current value of variable #2
#6 = #1 – #3
-35
Subtract contents of #3 from the contents of #1
#7 = #2 * 6
255
Multiply contents of #2 by 6
#8 = 70 / 80
0875
Divide 7 by 8 as real numbers
#9 = 7 / 8
0875
Divide 7 by 8 as integer numbers
Nesting
Nest ing means the con tents of brack ets (not pa ren the ses) will be pro cessed first – compare:
#10 = 90 – 30 / 20
75
Division first, then multiplication
#11 = [90 – 30] / 20
30
Multiplication first, then division
Copyright 2005, Industrial Press Inc, New York, NY – best mill drill wwwindustrialpresscom
FANUC CNC Custom Macros
114
Chapter 9
Arithmetic Operations and Vacant Variables