Hello Guest it is April 27, 2024, 06:14:56 PM

Author Topic: RefAllHome in Gcode end  (Read 200 times)

0 Members and 1 Guest are viewing this topic.

RefAllHome in Gcode end
« on: February 08, 2024, 04:02:24 AM »
Hi all guys!
A help please!
I need to perform a RefAllHome at end of my Gcode.
I did a macro m300:
Macro 300 --> RefAllHome ao fim do corte
function m300()
mc.mcCntlSetLastError(inst, "Referenciando eixos")   
wait = coroutine.create (RefAllHome) -- Referencia eixos
mc.mcCntlSetLastError(inst, "Referência completada")
end
But it doesn't work!
I think to create a macro that simply make a click in the button for RefAxis in the Mc4, bbut... I don´t know how i can make a 'click' in button through a macro!
Waiting for suggestions...!
Thank you in advance!
Re: RefAllHome in Gcode end
« Reply #1 on: February 08, 2024, 03:35:36 PM »
You cannot use the RefAll API call during g-code execution, it will fail.

Mach4 supports G28.1 for homing using g-code so use this instead of your mcode. See explanation below

Code: [Select]
G28.1 – Home Axis
 G28.1 physically homes the specified axes.  If more than one axis is specified, then the axes are homed in order
specified by the control configuration.  The values of the parameters are ignored except in the case of P.  If P is
specified, the corresponding out of band axis is homed.  Valid values for P are P6 through P11.  P can only be
specified once.
 Format: G28.1  X__  Y__  Z__  A__  B__  C__ P__
Re: RefAllHome in Gcode end
« Reply #2 on: February 08, 2024, 04:21:01 PM »
Hi swiftJ!
Thank you very much!
I do this and work fine!

Bye!!