Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: titchener on March 18, 2013, 11:26:31 PM

Title: Can you pass a lathe tool change number into a G code subroutine?
Post by: titchener on March 18, 2013, 11:26:31 PM
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.
Title: Re: Can you pass a lathe tool change number into a G code subroutine?
Post by: BR549 on March 19, 2013, 05:54:38 PM
Paul what part about the T#101 #101 is not working?

(;-) TP
Title: Re: Can you pass a lathe tool change number into a G code subroutine?
Post by: BR549 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

Title: Re: Can you pass a lathe tool change number into a G code subroutine?
Post by: cncalex 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
Title: Re: Can you pass a lathe tool change number into a G code subroutine?
Post by: BR549 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
Title: Re: Can you pass a lathe tool change number into a G code subroutine?
Post by: titchener 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.

Title: Re: Can you pass a lathe tool change number into a G code subroutine?
Post by: BR549 on March 20, 2013, 01:47:55 AM
IF you are not juggling offset you could probably run it as
T#101 M6