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

17.CUSTOM MACRO PROGRAMMING B-63324EN/03
- 632 -
- Local variable levels
- Local variables from level 0 to 5 are provided for nesting.
- The level of the main program is 0.
- Each time a macro is called (with G65, G66 or G66.1), the local
variable level is incremented by one. The values of the local
variables at the previous level are saved in the CNC.
- When M99 is executed in a macro program, control returns to the
calling program. At that time, the local variable level is
decremented by one; the values of the local variables saved when
the macro was called are restored.
Macro
(level 4)
O0006
:
:
:
:
:
M99 ;
Local variables
(level 0)
(Level 1)
#1
:
:
#33
1
:
#1
:
:
#33
2
:
(Level 2)
#1
:
:
#33
3
:
(Level 3)
#1
:
:
#33
4
:
(Level 4)
#1
:
:
#33
5
:
Common variables
#100-, #500-
Variables that can be read from and written to by macros at different levels
O0001 ;
:
#1=1 ;
G65 P2 A2 ;
:
:
M30 ;
Main program
(level 0)
Macro
(level 1)
Macro
(level 2)
Macro
(level 3)
O0002 ;
:
:
G65 P3 A 3;
:
:
M99 ;
O0003 ;
:
:
G65 P4 A4 ;
:
:
M99 ;
O0004 ;
:
:
G65 P5 A5 ;
:
:
M99 ;
O0005 ;
:
:
G65 P6 A6 ;
:
:
M99 ;
(Level 5)
#1
:
:
#33
:
6
Macro
(Level 5)

Leave a Reply

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