1
Mach4 General Discussion / Re: Automatically Activate Soft Limits (The same way the button does)
« on: February 20, 2018, 08:25:18 PM »
Thank you all for the replies!
I ended up using the code DazTheGaz posted, I just had to add a parenthesis on the first line and change the instance name. I added it to the end of the RefAllHome() and it works a treat in the simulation. I'll give it a try on my machine soon! Tick another job off the list!
Allan, I couldn't get that API Call to work unfortunately
Cheers,
Owen.
I ended up using the code DazTheGaz posted, I just had to add a parenthesis on the first line and change the instance name. I added it to the end of the RefAllHome() and it works a treat in the simulation. I'll give it a try on my machine soon! Tick another job off the list!
Code: [Select]
if mc.mcSignalGetState (mc.mcSignalGetHandle(inst, mc.OSIG_MACHINE_ENABLED)) == 1 then
mc.mcSoftLimitSetState(inst, mc.X_AXIS, mc.MC_ON)
mc.mcSoftLimitSetState(inst, mc.Y_AXIS, mc.MC_ON)
mc.mcSoftLimitSetState(inst, mc.Z_AXIS, mc.MC_ON)
wx.wxMessageBox("Machine is Homed and SoftLimits Enabled", "Homing Sequence",4)
else
wx.wxMessageBox("Homing Aborted", "Homing Sequence",4)
end
Allan, I couldn't get that API Call to work unfortunately
Cheers,
Owen.