Hello Guest it is October 09, 2024, 08:44:10 AM

Author Topic: How to do a conditional pause in a Mach tool change  (Read 3941 times)

0 Members and 1 Guest are viewing this topic.

How to do a conditional pause in a Mach tool change
« on: March 15, 2013, 11:03:15 PM »
I'm uisng Mach3 .057 to get a lathe running.

The lathe has a gang tool holder I made but sometimes I will also use quick change tools on it.

So the plan is for tool numbers less than 10 to have it do an automatic tool change and for tools 10 and greater (the manual tools) have it pause for manual change.

I've got the config option checked for an auto tool changer and I'm trying to put code in m6Start.m1s or m6End.m1s to pause when the tool number is 10 or greater.

I've tried putting the code below in both the m6start and m6end files but it doesn't do the pause.

Does Mach in lathe mode do the tool changes in a different way or are M00 commands ignored in these tool change macros?

If currenttool > 9 Then
Code "M00"
Message "Change to Tool Number " & currenttool
end if

Thanks,

Paul T.

Offline BR549

*
  •  6,965 6,965
Re: How to do a conditional pause in a Mach tool change
« Reply #1 on: March 16, 2013, 01:01:35 AM »
IF you are doing an auto tool change you have to put all the code in M6start as M6 does NOT run in auto mode. Only M6start runs.

SO all your conditional code will have to be in the 1 macro.

Should be simple enough, (;-)TP
Re: How to do a conditional pause in a Mach tool change
« Reply #2 on: March 16, 2013, 07:06:35 AM »
Great thinking Paul!  Please post your code when you get it working as I need to do something similar pretty soon.  Programming gives me the willies.
Milton from Tennessee ya'll.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
Re: How to do a conditional pause in a Mach tool change
« Reply #3 on: March 16, 2013, 07:34:21 AM »
First thing is M6End is not used in Turn Auto change so it is the M6Start you want to edit.
You also need to have AutoTool change selected in General Config.
Something like this in the M6 Start macro should do what you want.

 tool = GetSelectedTool()   
 If Tool >9 Then
  MsgBox "Change Tool then press OK"
  Else
   Message"ToolChanged"
 End If
SetCurrentTool( tool )     

Hood
« Last Edit: March 16, 2013, 07:35:58 AM by Hood »

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
Re: How to do a conditional pause in a Mach tool change
« Reply #4 on: March 16, 2013, 08:48:30 AM »
Actuall adding the tool number to the message box may make it even better,

 tool = GetSelectedTool()   
 If Tool >9 Then
  MsgBox ("Change to Tool   " & tool &"   then press OK")
  Else
   Message"ToolChanged"
 End If
 
 
SetCurrentTool( tool )   


Hood
Re: How to do a conditional pause in a Mach tool change
« Reply #5 on: March 16, 2013, 01:56:18 PM »
Hi Hood-

Thanks for explaining the auto tool change sequence and suggesting the code, I plopped it in to my M6Start macro and its working well.

I'm now pretty close to making some chips with the lathe, the only remaining issue is I still can't get jogging to work so I'm going to try to sort that out now.

Thanks,

Paul T.