
3.EXECUTION MACRO FUNCTION B-63943EN-2/01
- 16 -
3.2 CALLING AN EXECUTION MACRO
Macro call and subprogram call
Execution macro calls can roughly be divided into two types: macro
calls and subprogram calls. Macro calls are further divided into two
types: special macro calls using a T code/axis address, and other
macro calls.
Macro call
Subprogram call
Macro call using
G65/G66/G66.1/G/M code
Special macro call(*2)
Argument-
specification
Not allowed
All specifications after a call
code are passed as arguments
(#1 to #26). Two types are
available: argument specification
I and II.
All addresses specified in the
block are passed as arguments
(#1 to #33), and argument
specification II cannot be used.
NC command
specified in the
same block
The NC statement is first
executed, then the
execution macro is called.
A command after a call code is
treated as an argument. For a
command before a call code,
alarm PS0127 is issued. (A call
code must be specified at the
start of the block.)
Treated as an argument. (A call
code need not be placed at the
start of the block.)
Local variables
The level does not
change(*1).
The level changes.
Simple calls and modal calls are also included in macro calls. A
simple call (also called a macro call) calls an execution macro only in
the specified block. A modal call calls an execution macro in each
block until G67 is specified.
*1 Usually, the level is not changed by a subprogram call.
When bit 3 (LCLLV) of compile parameter (No. 9163) is set to 1,
Series 16i compatibility is provided. This means that the level
changes only when an execution macro is called as a subprogram
from a user program (using an M/S/T/second auxiliary
function/specific code).
*2 Special macro calls include calls using a T code/axis address.
Types of calls
Call code
Program number
called
Common
variable for
storing a
specified code
Parameters to be set Remarks
Simple call (G65)
Specified at
address P.
None None
No execution macro
can be called from any
user program using
this command.
Modal call (G66,G66.1)
Specified at
address P.
None None
No execution macro
can be called from any
user program using
this command.