
16.CUSTOM MACRO PROGRAMMING B-63944EN/02
- 452 -
16.7.5 Macro Call Using a G Code (Specification of Multiple
Definitions)
By setting the starting G code number used to call a macro program,
the number of the starting program to be called, and the number of
definitions, macro calls using multiple G codes can be defined.
Explanation
As many custom macros as the number specified in parameter No.
6040 can be called using as many G codes as the number specified in
parameter No. 6040. The numeric value set in parameter No. 6038
indicates the starting G code number and the program number set in
parameter No. 6039 indicates the starting program number. To
disable this type of call, set 0 in parameter No. 6040.
When a negative G code is set in parameter No. 6038, modal calls are
performed. In this case, bit 3 (MGE) of parameter No. 6007 can be
set to select the G66 or G66.1 mode.
The number of repetitions and argument specification are set in the
same way as with a macro call using a G code.
[Example]
Set parameter No. 6038 to 900, parameter No. 6039 to 10000000, and
parameter No. 6040 to 100.
G900 → O10000000
G901 → O10000001
G902 → O10000002
:
G999 → O10000099
Custom macro calls (simple calls) for 100 combinations are defined as
shown above. When parameter No. 6038 is changed to -900, custom
macro calls (modal calls) for the same combinations are defined.
NOTE
1 The calls defined by this setting become all invalid in
the following cases:
<1> A value outside the valid data range is set in
one of the above parameters.
<2> (No. 6039 + No. 6040 - 1) > 99999999
2 Simple and modal calls cannot be mixed in the
specification.
3 If the G code set in parameter Nos. 6050 to 6059 to
call the corresponding macro program is within the
G code range for calling programs using multiple G
codes, the macro program corresponding to the G
code set in parameter Nos. 6050 to 6059 is called.