what is meaning of macro
what is meaning of macro
It creates sub programs so you can reduce the size of the program. Lets say your milling a pocket 5" deep, but your only taking .05" DOC. That would be a lot of lines. Using macros, your program would basically change to a position move, Z depth, and then repeat the sub-program. The sub program would be the linear moves for the pocket that repeated every depth of cut.
Heres an example of the same program with and without macros:
Without Macros
G00 G55 G90 G80 G40 G28 Z0.0
M19
M06 T8
S2037 M03
G00 X10.2594 Y0.2354
G43 Z1.0 T8 H8 M08
Z0.1
G01 Z-0.0199 F24.4
G41 D8X10.1326 Y0.2014
X10.1126 Y0.1814
G02 X9.98 Y0.1265 I-0.1326 J0.1326
G01 X8.75
G03 X8.75 Y-0.1265 I0. J-0.1265
G01 X9.98
G02 X10.1126 Y-0.1814 I0. J-0.1875
G01 X10.1326 Y-0.2014
G40 X10.2594 Y-0.2354
Y0.2354
Z-0.0398
G41 D8X10.1326 Y0.2014
X10.1126 Y0.1814
G02 X9.98 Y0.1265 I-0.1326 J0.1326
G01 X8.75
G03 X8.75 Y-0.1265 I0. J-0.1265
G01 X9.98
G02 X10.1126 Y-0.1814 I0. J-0.1875
G01 X10.1326 Y-0.2014
G40 X10.2594 Y-0.2354
Y0.2354
Z-0.0597
With Macros
G00 G55 G90 G80 G40 G28 Z0.0
M19
M06 T8
S2037 M03
G00 X10.2594 Y0.2354
G43 Z1.0 T8 H8 M08
Z0.1
G01 Z-0.0199 F24.4
N100 P6601 M98
G01 Y0.2354
Z-0.0398
N115 P6601 M98
G01 Y0.2354
Z-0.0597
The sub program would look like this
O6601
( ROUGH1 SIDE )
( ENDMILL0375:4REG )
N520 G01 G41 D8 X10.1326 Y0.2014 F24.4
N525 X10.1126 Y0.1814
N530 G02 X9.98 Y0.1265 I-0.1326 J0.1326
N535 G01 X8.75
N540 G03 X8.75 Y-0.1265 I0. J-0.1265
N545 G01 X9.98
N550 G02 X10.1126 Y-0.1814 I0. J-0.1875
N555 G01 X10.1326 Y-0.2014
N560 G40 X10.2594 Y-0.2354
N565 M99
It basically a repeat of designated lines, similar to a finish can cycle. It also work well on a lathe, if you want to run more than one part with a bar puller or a bar feeder.
grumpy is right on here. If i do something daily or tool change or repeatedly, i write a simple macro. IE: M6 means about ten lines of redundant code to me, get the machine out of the way, do some crap I don't think about, make this mess easy. Now depending the controller these can be protected against accidental deletion or alteration. Sorry so vague.
OH! depending on the controller, you can assign your own code to a macro, OK that's COOL!