(Common to Power Mate i–D and –H)
13. CUSTOM MACRO
Variables are classified into four types by variable number.
Table 13.1 Types of variables
This variable is always null. No value can be
assigned to this variable.
#1 – #33 Local
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
#100 – #199
#500 – #699
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
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.
A referenced variable value is automatically rounded according to the
least input increment of the address.
When G00X#1; is executed on a 1/1000–mm CNC with 12.3456
assigned to variable #1, the actual command is interpreted as
To reverse the sign of a referenced variable value, prefix a minus sign (–)
When an undefined variable is referenced, the variable is ignored up to an
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