Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: adiniz 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!
-
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
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__
-
Hi swiftJ!
Thank you very much!
I do this and work fine!
Bye!!