60
« on: August 06, 2018, 06:50:35 PM »
lumber60,
As I mentioned in another Post, 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, this is an alternate method if you find that you have issues with Mach4 and your Controller when Homing.
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