Hello Guest it is April 19, 2024, 04:36:38 PM

Author Topic: G-Code to reference all axis  (Read 1115 times)

0 Members and 1 Guest are viewing this topic.

G-Code to reference all axis
« 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
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: G-Code to reference all axis
« Reply #2 on: March 26, 2019, 02:49:02 PM »
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
Re: G-Code to reference all axis
« Reply #3 on: March 26, 2019, 03:00:09 PM »
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
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'