A few questions about the M6 macro

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

A few questions about the M6 macro

Postby Ggfr » Mon Jun 23, 2025 8:00 am

Hi Guys,

We are currently building a custom M6 macro to support automatic tool change on our machines, and things are going quite well! However, we have encountered a few hiccups that we need help for :)

- First one is that on a few occasion, without being able to pin point the "why", the macro has "bugged" and executed all steps without any movement, leading to the machine just releasing the tool holder where it is located, instead of in the tool rack. On each occasion, restarting UCCNC fixed the problem, but it is a little bit puzzling.. Any idea of what could cause that?

- Second, we wanted to add the tool measurement after each toolchange. So we wouldn't have to reinvent the wheel, we decided to use the "start" probe button to run the standard UCCNC probe sequence.
When we do a manual toochange (MDI or tool change button) it works perfectly, but when we try to run it inside a GCode, it just skips the probing sequence.
Is there something that we missed there?

Thank you very much and have a nice day!
GGfr
Ggfr
 
Posts: 10
Joined: Tue Dec 10, 2024 4:24 pm

Re: A few questions about the M6 macro

Postby Algone » Tue Jun 24, 2025 11:01 am

You should post the macro, although I'm not sure I can help you.
If the M6 ​​macro is ignored in the Gcode, you should refer to the "error log" file, which is located in the same location as the macro.
Algone
 
Posts: 32
Joined: Thu Jun 20, 2024 10:23 pm

Re: A few questions about the M6 macro

Postby cncdrive » Wed Jun 25, 2025 3:09 am

Yes, you should post your macro to let us see if there is any problematic part.
In general you should handle error events in your macro, you can check the exec.Ismacrostopped() function, it returns a boolean value depending on if a macro execution stop was requested by any other macros, macroloops, buttons, plusins etc.
If you don't handle that then a call to the exec.stop() function will stop executing motion commands in your macro, but will execute other things like text writtings, DROs values changings etc., so please handle this in your macro.

Yes, you can call the UCCNC built in probing buttons, we did this many times for customers without issues.
cncdrive
Site Admin
 
Posts: 5198
Joined: Tue Aug 12, 2014 11:17 pm

Postby Ggfr » Wed Jun 25, 2025 10:14 am

Hi,

Thank you for the inputs!

@Algone, the macro isn't ignored, it's ran perfectly except the probing sequence which is just skipped somehow.

@cncdrive, thank you for the hint! I'll see how to handle these more cleanly then!

regarding the probing button, any hint on why it would work using mdi but not in a gcode?

thanks!
GGfr
Ggfr
 
Posts: 10
Joined: Tue Dec 10, 2024 4:24 pm


Return to Macros

Who is online

Users browsing this forum: No registered users and 6 guests