
3.EXECUTION MACRO FUNCTION B-63943EN-2/01
- 50 -
3.2.12 Subprogram Call Using M Code in the Specified Range
Execution macro O9009 is called as a subprogram using an M code in
the range specified by compile parameters Nos. 9042 and 9043.
Format
*1 When bit 2 (PCDC) of compile parameter (No. 9163) is set to 1,
a call can be made from an execution macro.
Argument
The specified M code is passed to variable #148.
Local variable levels
By setting bit 3 (LCLLV) of compile parameter (No. 9163) to 1, the
level can be changed as in the case of macro calls when an execution
macro is called from a user program. In this case, all local variables
are set to <null> when an execution macro is called. (Series 16i
compatibility specifications)
When an execution macro is called from another execution macro, the
level remains unchanged as in the case where bit 3 (LCLLV) of
compile parameter (No. 9163) is set to 0. In this case, the local
variables at the call source are passed.
Limitation
1 Usually, when an execution macro is called from a program
called using an M code, only a G65 or M98 command can be
specified. When bit 2 (PCDC) of compile parameter (No.
9163) is set to 1, G66 and G66.1 are also usable. Moreover,
when bit 2 (PCDC) of compile parameter (No. 9163) is set to 1,
a call using a G code can be made from a program called using
an M code by setting bit 6 (GMP) of parameter (No. 6008) to 1.
This parameter is an ordinary parameter, so that this parameter
can be modified, for example, through the MDI panel.
2 This type of subprogram call is invalidated in the following
cases:
<1> A value outside the valid range is set for a compile
parameter.
<2> The value set for compile parameter (No. 9042) is greater
than the value set for parameter (No. 9043).
Mm L l ;
m : Call M code
l : Repetition count (1 by default)
1 to 999999999
User program
(1)
Execution macro
O0001 ;
:
M200 L2 ;
:
M30 ;
O9009 ;
:
:
:
M99 ;
Compile parameter (No.9042)=200,
(No.9043)=210