JamieR Frequent Poster
Joined: 30 Jun 2004 Posts: 54 Location: Chicago
|
Posted: Fri Jul 02, 2004 12:05 pm Post subject: Macro to Automatically Set Tool Lengths on a Mazak Mill |
|
|
This simple macro automates setting tools on a Mazak mill with a tool eye. The operator enters the starting tool number to be set in #537 and the ending tool number in #538. You could change #537 and #538 to a variable for a tool number if that would be more convenient. See Not Enough Common Variables for details on how to use tool numbers for variables. For example, change #537 to #2064 to use tool offset 64 instead of macro variable 537.
You will need to edit the line IF[#537GT29]GOTO100 to equal the number of tools in your machine's tool changer. This machine had a 30 station tool changer but station 30 is dedicated to a Renishaw probe.
Code: | %
O9103
(SET TOOL LENGTHS)
(#537=STARTING TOOL NUMBER)
(#538=ENDING TOOL NUMBER)
G0G91G30Z0
G0G91G30Y0
IF[#537GT#538]GOTO101
IF[#537GT29]GOTO100
IF[#538GT29]GOTO100
WHILE[#537LE#538]DO1
T#0T#537M6
T#537T0M6
M196
T#537
M197
G0G91G30Z0
G0G91G30Y0
#537=#537+1
END1
GOTO102
N100#3000=1(#537 IS TOO LARGE)
N101#3000=1(#537 GREATER THAN 538)
N102 G0G91G30Z0
G0G91G30Y0
M30
% |
It works for me. |
|