B-63324EN/03 PROGRAMMING 17.CUSTOM MACRO
- 669 -
17.14.2 Details of Functions
- Subprogram-type interrupt and macro-type interrupt
There are two types of custom macro interrupts: Subprogram-type
interrupts and macro-type interrupts. The interrupt type used is
selected by MSB (bit 1 of parameter 7002).
(a) Subprogram-type interrupt: MSB(bit 0 of parameter 7002) is 1
An interrupt program is called as a subprogram. This means that
the levels of local variables remain unchanged before and after the
interrupt. This interrupt is not included in the nesting level of
(b) Macro-type interrupt: MSB(bit 1 of parameter 7002) is 0
An interrupt program is called as a custom macro. This means
that the levels of local variables change before and after the
interrupt. The interrupt is not included in the nesting level of
custom macro calls. When a subprogram call or a custom macro
call is performed within the interrupt program, this call is included
in the nesting level of subprogram calls or custom macro calls.
Arguments cannot be passed from the current program even when
the custom macro interrupt is a macro-type interrupt.
- M codes for custom macro interrupt control
In general, custom macro interrupts are controlled by M96 and M97.
However, these M codes, may already being used for other purposes
(such as an M function or macro M code call) by some machine tool
builders. For this reason, MPR (bit 2 of parameter 7002) is provided to
set M codes for custom macro interrupt control.
When specifying this parameter to use the custom macro interrupt
control M codes set by parameters, set parameters 7033 and 7034 as
follows: Set the M code to enable custom macro interrupts in
parameter 7033, and set the M code to disable custom macro interrupts
in parameter 7034. When specifying that parameter-set M codes are
not used, M96 and M97 are used as the custom macro control M codes
regardless of the settings of parameters 7033 and 7034.
The M codes used for custom macro interrupt control are processed
internally (they are not output to external units). However, in terms of
program compatibility, it is undesirable to use M codes other than M96
and M97 to control custom macro interrupts.
- Custom macro interrupts and NC statements
When performing a custom macro interrupt, the user may want to
interrupt the NC statement being executed, or the user may not want to
perform the interrupt until the execution of the current block is
completed. MIN (bit 4 of parameter 7002)is used to select whether to
perform interrupts even in the middle of a block or to wait until the end
of the block.