61
Mach4 General Discussion / Re: Can someone please explain how to use Home offsets
« on: August 02, 2018, 08:01:56 PM »
Hi,
You could do it in Screen Load Script.
The first one is not Ref all Home part of Mach4 screen set and the Second one is you add another button below the first and resize the first so it fits and call the function like the Ref all Home but with the following.
Then you can make the offsets like you need for your machine needs.
Regards,
Mauri.
In New Button
RefAllHomeWithOffset()
-- Homing Offset
offset_applied ="false";
In Screen Load Script.
---------------------------------------------------------------
-- 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
---------------------------------------------------------------
-- Ref All Home With Offset() function.
---------------------------------------------------------------
function RefAllHomeWithOffset()
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
mc.mcCntlGcodeExecute(inst, "G1 X0.1 Y0.1 F30")
--mc.mcCntlGcodeExecute(inst, "G1 X0.1 Y0.1 Z0.1 F30")
coroutine.yield()
wx.wxMessageBox('Referencing and Offset Completed')
end
You could do it in Screen Load Script.
The first one is not Ref all Home part of Mach4 screen set and the Second one is you add another button below the first and resize the first so it fits and call the function like the Ref all Home but with the following.
Then you can make the offsets like you need for your machine needs.
Regards,
Mauri.
In New Button
RefAllHomeWithOffset()
-- Homing Offset
offset_applied ="false";
In Screen Load Script.
---------------------------------------------------------------
-- 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
---------------------------------------------------------------
-- Ref All Home With Offset() function.
---------------------------------------------------------------
function RefAllHomeWithOffset()
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
mc.mcCntlGcodeExecute(inst, "G1 X0.1 Y0.1 F30")
--mc.mcCntlGcodeExecute(inst, "G1 X0.1 Y0.1 Z0.1 F30")
coroutine.yield()
wx.wxMessageBox('Referencing and Offset Completed')
end