FANUC Series 16/18/160/180-Model C Machining Center Operators Manual

PROGRAMMING
16. CUSTOM MACRO
B–62764EN/01
372
Local and common variables can have value 0 or a value in the following
ranges :
–10
47
to –10
–29
10
–29
to 10
47
If the result of calculation turns out to be invalid, an P/S alarm No. 111
is issued.
When a variable value is defined in a program, the decimal point can be
omitted.
Example:
When #1=123; is defined, the actual value of variable #1 is 123.000.
To reference the value of a variable in a program, specify a word address
followed by the variable number. When an expression is used to specify
a variable, enclose the expression in brackets.
Example: G01X[#1+#2]F#3;
A referenced variable value is automatically rounded according to the
least input increment of the address.
Example:
When G00X#1; is executed on a 1/1000–mm CNC with 12.3456
assigned to variable #1, the actual command is interpreted as
G00X12.346;.
To reverse the sign of a referenced variable value, prefix a minus sign (–)
to #.
Example: G00X–#1;
When an undefined variable is referenced, the variable is ignored up to an
address word.
Example:
When the value of variable #1 is 0, and the value of variable #2 is null,
execution of G00X#1Y#2; results in G00X0;.
For two–path control, macro variables are provided for each path. Some
common variables, however, can be used for both paths, by setting
parameters No. 6036 and 6037 accordingly.
When the value of a variable is not defined, such a variable is referred to
as a “null” variable. Variable #0 is always a null variable. It cannot be
written to, but it can be read.
(a)Quotation
When an undefined variable is quotated, the address itself is also
ignored.
[Example] When #1 is 0 and #2 is null, the result of executing G00
X#1 Y#2; will be the same as when G00 X0; is executed.
D Range of variable values
D Omission of the decimal
point
D Referencing variables
D Common custom macro
variables for tow paths
(two–path control)
D Undefined variable

Leave a Reply

Your email address will not be published. Required fields are marked *