291
Mach4 General Discussion / Re: Home Signal
« on: February 21, 2018, 09:12:43 AM »
But if I did that then I would have no spindle speed feedback and wouldn't be able to do threading.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
local function myHomeC()
local inst=mc.mcGetInstance()
local rc,sState
local pos=-1
local hSigH=mc.mcSignalGetHandle(inst,mc.ISIG_MOTOR3_HOME)
rc=mc.mcSignalEnable(hSigH,1)
local hSig,rc=mc.mcSignalGetHandle(inst,mc.ISIG_INDEX)
if rc==mc.MERROR_SIGNAL_NOT_FOUND then
wx.wxMessageBox('wrong Signal')
end
sState=mc.mcSignalGetState(hSig)
if sState==1 then -- sitting on the slot so move off it
mc.mcCntlGcodeExecuteWait(inst,'g0 f20000 h15\n')--g1 h366 f5000')
end
mc.mcAxisHome(inst,mc.C_AXIS)
repeat
wx.wxMilliSleep(1000)
rc= mc.mcAxisIsHoming(inst,mc.C_AXIS)
mc.mcCntlSetLastError('Homing: '..tostring(rc))
until rc==0
rc=mc.mcSignalEnable(hSigH,0)
end
myHomeC()