Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: biggermens on March 26, 2019, 01:40:26 PM
-
Hi There
I been looking for a while, would be here a G-Code that will reference all axis like clicking the Home Button ???
Thanks
Biggs
-
Hi,
https://www.machsupport.com/forum/index.php?topic=39729.0 (https://www.machsupport.com/forum/index.php?topic=39729.0)
Craig
-
I Looked at that
I can call the script with a M code ??
-- Ref All Home() function.
---------------------------------------------------------------
function RefAllHome()
mc.mcAxisDerefAll(inst) --Just to turn off all ref leds
mc.mcAxisHomeAll(inst)
coroutine.yield() --yield coroutine so we can do the following after motion stops
----See ref all home button and plc script for coroutine.create and coroutine.resume
wx.wxMessageBox('Referencing is complete')
end
-
Hi,
no, not directly.
When you call an M code the Gcode interpreter has control of the machine, that is Machs Core chunk.
The function whose code you posted is in the screen load script , that is its part of the GUI chunk.
Only one chunk can run at a time.
You can make your own M code using the same API's although I wouldn't bother with the co-routine part.
Craig