Hello Guest it is April 27, 2024, 08:42:17 PM

Author Topic: Set Tool Number in Gcode?  (Read 1825 times)

0 Members and 1 Guest are viewing this topic.

Set Tool Number in Gcode?
« on: September 05, 2023, 05:04:23 PM »
Is it possible to set the tool number in Gcode? I have been searching all the docs and it seems like the answer is no.

I run my program the first time and tool number is one. Stops for the tool change (T2 M6) and tool number changes to 2. Awesome
Run the same program the second time. Tool number is still 2. Ignores the tool change because tool number matches the tool needed.
Added an unwanted tool change (T1 M6) so now i have to click cycle start twice every time i run after the first time to change the tool number back to 1.
Edited the M6 script forcing the stop at all M6 commands so no tool change is ignored. Awesome
Now the tool number is always 2.

I can live with that because it funtions the way i want it to. But thought I would ask. Is there a way to reset the tool number using a Gcode command? This way I could put the M6 macro back together, set the tool number to match the first tool in all my code, and skip the first tool change and not have to click twice!

But I think i already know the answer.

Offline Bill_O

*
  •  563 563
    • View Profile
Re: Set Tool Number in Gcode?
« Reply #1 on: September 05, 2023, 05:38:22 PM »
I think you can just click on the tool number and type the tool you want then hit Enter
Re: Set Tool Number in Gcode?
« Reply #2 on: September 05, 2023, 05:51:17 PM »
Yeah I realize that but if i forget to do that and that #2 tool change gets skipped I have a ruined part. I'll just have to find a way to ignore the display.

Offline smurph

*
  • *
  •  1,546 1,546
  • "That there... that's an RV."
    • View Profile
Re: Set Tool Number in Gcode?
« Reply #3 on: September 05, 2023, 06:41:07 PM »
I'm fixing to add M61 as a means to do just this.  I'll post when there is a build up with this in it. 

Steve


Re: Set Tool Number in Gcode?
« Reply #4 on: September 05, 2023, 07:09:09 PM »
That would be great. I have to learn Lua. So many things would be doable if i had a good understanding

Offline Bill_O

*
  •  563 563
    • View Profile
Re: Set Tool Number in Gcode?
« Reply #5 on: September 06, 2023, 08:37:27 AM »
Steve,

I am not a programmer and it took me a little while to get the hang of the LUA.
I put this together to help other people.
https://www.machsupport.com/forum/index.php?topic=45397.msg289143#msg289143

Bill
Re: Set Tool Number in Gcode?
« Reply #6 on: September 06, 2023, 09:12:26 AM »
Thank you. I'll take a peek later today after I get my chores done.

Offline smurph

*
  • *
  •  1,546 1,546
  • "That there... that's an RV."
    • View Profile
Re: Set Tool Number in Gcode?
« Reply #7 on: September 06, 2023, 06:08:44 PM »
Build 5194 is up with M61 in it.  Check the docs on how to use it.  Basically M61 Q1.  Q sets the tool number.  Q0 means no tool installed. 

Steve
Re: Set Tool Number in Gcode?
« Reply #8 on: September 06, 2023, 06:27:07 PM »
Awesome thank you
Re: Set Tool Number in Gcode?
« Reply #9 on: September 06, 2023, 06:36:24 PM »
Just checked 2.0.5036 is up on the site. Can't find anything about 5194. Where should I look?