Hello Guest it is March 17, 2026, 06:02:35 PM

Author Topic: Assign Button to Call M132  (Read 171 times)

0 Members and 1 Guest are viewing this topic.

Assign Button to Call M132
« on: March 15, 2026, 02:58:28 PM »
I've got a RapidChange Solo ATC setup on my CNC. To probe for Z zero, I now use M132. I'd like to create a button on one of the dashboards to call this M code. But in reviewing all options (that I can find), there is no clear way to do this, except to create a user script.

The documentation here, https://support.machmotion.com/books/shared-content-public-f71/page/machpro-widgets-dashboard-commands-and-function-buttons#bkmrk-user-commands  is somewhat vague IHMO on what can be done.  It states the following:

Quote
One option for user commands are User Scripts. These are lua functions that will be executed as the command, to get the feedback state, or to forward to the target. This is a way to create completely custom functionality. They should always be done in the UserGUIModule.UserStartUpScript function. The following is an example of how to create these lua function in the UserGUIModule.

Within the Profile > Router > Macros > Scripts folder, there are several files that might be the right candidate, but which one is unclear. In none of those files is the section (or function) labeled UserGUIModule.UserStartUpScript.

Is this still a work in progress, or is there something that I may have missed, or is there a better way to have a button call and execute M132?

My preference is that on pressing the button, it will call M132 and CycleStart if that is necessary.  My only option right now is to use MDI and CycleStart, which is really inconvenient.
Re: Assign Button to Call M132
« Reply #1 on: March 17, 2026, 02:54:13 PM »
Go to Mach\Profile\{Profile name}\ Macros\Scripts
Here you will make a copy of UserMCodeModuleDefault.mcs and rename the copy to UserMCodeModule.mcs

From here, you can start editing the file.

Add your function in like below

function UserMCodeModule.m132()

    --insert user data here..

end

This will add your macro to your MCodes.

On the side note, we are in the process of adding the RapidChange ATC to our list of Tool Changers in the core of mach. I expect 1-2 weeks for this.
Thanks,

Paul
Re: Assign Button to Call M132
« Reply #2 on: March 17, 2026, 03:04:04 PM »
Thanks for the reply Paul. I'm a beta tester, so hope to see the RapidChange ATC code earlier than later. I may watch for it in the Development branch. As there are at least three varieties of ATCs from them (ATC, STC, and MTC), should I expect to see all of them included in the initial release?  Having a Solo, that is what I'm most interested in.
Re: Assign Button to Call M132
« Reply #3 on: March 17, 2026, 03:31:04 PM »
That would be up to the RapidChange team as the ball is currently in their court. I assume they would add logic for all of their current varieties.
Thanks,

Paul