67
« on: March 19, 2021, 12:29:06 PM »
This is code that has worked prior to updating to 4612. This homes my C axis (rotary) in the left up script. When I step through the code in debugger it homes but when clicked no homing takes place. Last message is output, 'Homing: 0.0'.
Any Ideas?
local function myHomeC()
local inst=mc.mcGetInstance()
local sState
local pos=-1
mc.mcCntlEnable(inst,0)
mc.mcCntlConfigStart(inst)
local hSigH=mc.mcSignalGetHandle(inst,mc.ISIG_MOTOR3_HOME)
rc=mc.mcSignalEnable(hSigH,1)
mc.mcProfileWriteInt(inst,'Signal68','Enabled',1)
mc.mcProfileSave(inst)
mc.mcProfileFlush(inst)
mc.mcCntlConfigStop(inst)
mc.mcCntlEnable(inst,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
rc=mc.mcAxisHome(inst,mc.C_AXIS)
--this never gets executed
mc.mcCntlSetLastError(inst,'Homing')
repeat
wx.wxMilliSleep(1000)
rc= mc.mcAxisIsHoming(inst,mc.C_AXIS)
mc.mcCntlSetLastError(inst,'Homing: '..tostring(rc))
until rc==0
rc=mc.mcSignalEnable(hSigH,0)
mc.mcProfileFlush(inst)
end
if (mc.mcInEditor() == 1) then
myHomeC()
end
TIA
RT