Manufacturing Information Solutions Forum Index Manufacturing Information Solutions
Your Place for Support and Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Macro to Automatically Set Tool Lengths on a Mazak Mill

 
Post new topic   Reply to topic    Manufacturing Information Solutions Forum Index -> G-Code Programming
View previous topic :: View next topic  
Author Message
JamieR
Frequent Poster


Joined: 30 Jun 2004
Posts: 54
Location: Chicago

PostPosted: Fri Jul 02, 2004 12:05 pm    Post subject: Macro to Automatically Set Tool Lengths on a Mazak Mill Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Manufacturing Information Solutions Forum Index -> G-Code Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group