Fanuc Power Mate i-D/H Operator Manual

PROGRAMMING
(Common to Power Mate i–D and –H)
B–63174EN/03
13. CUSTOM MACRO
105
Variables are classified into four types by variable number.
Table 13.1 Types of variables
Variable
number
Type of
variable
Function
#0 Always
null
This variable is always null. No value can be
assigned to this variable.
#1 – #33 Local
variables
Local variables can only be used within a
macro to hold data such as the results of op-
erations. When the power is turned off, local
variables are initialized to null. When a mac-
ro is called, arguments are assigned to local
variables.
#100 – #199
#500 – #699
Common
variables
Common variables can be shared among
different macro programs. When the power
is turned off, variables #100 to #199 are ini-
tialized to null. Variables #500 to #699 hold
data even when the power is turned off.
#1000 – System
variables
System variables are used to read and write
a variety of CNC data items such as the cur-
rent position and tool compensation values.
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;.
Types of variables
Referencing variables

Leave a Reply

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