Fanuc Power Mate i-D/H Operator Manual

PROGRAMMING
(Common to Power Mate i–D and –H)
13. CUSTOM MACRO
B–63174EN/03
104
An ordinary operation program specifies a G code and the travel distance
directly with a numeric value; examples are G100 and X100.0.
With a custom macro, numeric values can be specified directly or using
a variable number. When a variable number is used, the variable value
can be changed by a program or using operations on the MDI panel.
#1=#2+100 ;
G01 X#1 F300 ;
When specifying a variable, specify a number sign (#) followed by a
variable number. Personal computers allow a name to be assigned to a
variable, but this capability is not available for custom macros.
Example: #1
An expression can be used to specify a variable number. In such a case,
the expression must be enclosed in brackets.
Example: #[#1+#2–12]
Local and common variables can have value 0 or a value in the following
ranges :
–10
47
to –10
–29
0
+10
–29
to +10
47
If the result of calculation turns out to be invalid, an 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.
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.
13.1
VARIABLES
Explanation
Variable representation
Range of variable values
Omission of the decimal
point
Undefined variable

Leave a Reply

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