Hello Guest it is March 29, 2024, 08:31:15 AM

Author Topic: Can you pass a lathe tool change number into a G code subroutine?  (Read 3636 times)

0 Members and 1 Guest are viewing this topic.

I've got my new Mach controlled lathe up and running and its working well and thanks for the help from forum members here to get it running.

I've got a nice set of canned macros I wrote for a different lathe that I want to get running on this one.

Unfortunately the tool change format Mach uses for lathes, ie, "T0202 M6" is different than the other lathe.

The macros depend on being able to set a parameter to do the tool change, ie

#101=10

and then accessing that parameter in a subroutine that makes the tool change to tool 10.

So far efforts to execute something like:

T#101#101

aren't working.

Is there any way I'll be able to do a lathe tool change in a subroutine based on a parameter setting?

Thanks,

Paul T.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Can you pass a lathe tool change number into a G code subroutine?
« Reply #1 on: March 19, 2013, 05:54:38 PM »
Paul what part about the T#101 #101 is not working?

(;-) TP

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Can you pass a lathe tool change number into a G code subroutine?
« Reply #2 on: March 19, 2013, 06:16:52 PM »
OK I see whta is happening, a big ol OOPS in mach3. It does not accept the double #var assignment to the T#

What you can do is solve the T# as an equation. BUT you have to always use  numbers of 10 -90  as tool numbers

#101=10

T[#101 *100 +#101]   (= T1010)

Just a thought, (;-)TP

Re: Can you pass a lathe tool change number into a G code subroutine?
« Reply #3 on: March 19, 2013, 06:47:54 PM »
Hi,
Quote
BUT you have to always use  numbers of 10 -90  as tool numbers
?

#101=1

T[#101 *100 +#101]   (= T101)

should work.  ;)

Alex

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Can you pass a lathe tool change number into a G code subroutine?
« Reply #4 on: March 19, 2013, 10:07:31 PM »
True but I was sticking with the OLD  definition of the Tool Call T#### .

It should work with all the variants of Mach3 (;-)

(;-)TP
Re: Can you pass a lathe tool change number into a G code subroutine?
« Reply #5 on: March 20, 2013, 01:27:33 AM »
Thanks for the suggestions fellas. I ended up making an M macro that takes a P parameter that has the tool number, so I can call it like- M700 P#101. Then in the macro I construct the T*********x command and execute it with "Call Code" call, its working well.

Paul T.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Can you pass a lathe tool change number into a G code subroutine?
« Reply #6 on: March 20, 2013, 01:47:55 AM »
IF you are not juggling offset you could probably run it as
T#101 M6