Fanuc Series 15i/150i-MA (Programming) Operators Manual

- 580 -
An ordinary machining 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 ;
- Variable representation
Specify a variable number after a sharp (#).
[Example] #5
A variable may also be represented by an <expression>, described
below in "Operation command," as shown below :
[Example] #[#100]
Variable #i in the subsequent description can be replaced by variable
- Types of variables
Variables are classified, according to their variable number, as local
variables, common variables, or system variables. Each group of
variables has different applications and attributes. In addition, read-
only system constants are supported.
- Local variable #1 to #33
The local variable is a variable locally used in the macro. That is, a
local variable #i used in the macro and called at one point in time, is
different from #i used in the macro (whether it is the same macro or
not) called at another point in time. Accordingly, when macro B is
called from macro A, as in a multiplex call, a local variable used in
macro A is not destroyed by being used in macro B
A local variable is used for an argument transfer. For information on
the correspondence to the argument address, refer to section 17.1 for
Macro Call Command. A local variable without a transferred argument
is vacant in its initial status and can be used freely. The local variables
have the read/write attribute.

Leave a Reply

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