16. CUSTOM MACRO
B–63172EN/01
NC FUNCTION
92
- Sub program call by T code
By setting parameter, sub program can be called by T codes. When
commanded:
N_ G_ X_ Y_ … Tt ; ,
the same operation is done as when commanded:
#149 = t;
N_ G_ X_ Y_ … M98 P9000; .
The T type code t is stored as arguments of common variable #149.
This command cannot be done in the same block with a sub program
calling M code, or with M98 command. The T code is not output.
When T code is commanded in macros called by G code, or in sub
programs called by M codes or T codes, the T code is treated as
ordinary T codes.
Variables are divided into local variables, common variables, and system
variables, according to their variable numbers. Each type has different use
and nature.
- Local variables #1 – #33
Local variables are variables used locally in the macro. Accordingly,
in case of multiples calls (calling macro B from macro A), the local
variable used in macro A is never destroyed by being used in macro
B.
- Common variables #100 – #199, #500 – #699
Compared with local variables used locally in a macro, common
variables are common throughout the main program, each sub
program called from the main program, and each macro. The common
variable #1 used in a certain macro is the same as the common variable
#i used in other macros. Therefore, a common variable #1 calculated
in a macro can be used in any other macros.
Common variables #100 to #199 are cleared when power is turned off
or reset, but common variables #500 to #699 are not cleared after
power is turned off.
- System variables
A variable with a certain variable number has a certain value. If the
variable number is changed, the certain value is also changed.
The certain value are the following:
Z PMC interface signals (16 points DI and 48 points DO)
Z D/R area information for PMC
Z Tool offset amount
Z Position information (actual position, skip position, block end
position, etc.)
Z Modal information (F code, G code for each group, etc.)
Z Alarm message (Set alarm number and alarm message, and the
CNC is set in an alarm status. The alarm number and message is
displayed.)
Z A date (year, month, day) and time (hour, minute, second) are
indicated.
Z Clock (Time can be known. A time can also be preset.)
Z Single block stop, Miscellaneous function end wait hold
Z Feed hold, Feed rate override, Exact stop inhibition
Z The number of machining parts is indicated. It can be preset.
D Types of variables