andyf Posted October 10, 2014 Posted October 10, 2014 I have a program that indexes a motor, but I need to jog indefinite until I hit a hard limit before issuing a home command. Is there any way to prevent a motion program from aborting when hitting a hard limit? One approach I've used is to temporarily disable the hard limits, jog until trigger to a hard limit flag, reenable the hard limit, and then home. I'm just wondering if there is an easier way to accomplish this without having to disable/enable hard limits.
andyf Posted October 10, 2014 Author Posted October 10, 2014 OK thanks Steve. Since there is no jog indefinite until trigger and I also have soft limits, what I ended up doing is homing once into the negative limit and then homing in the opposite direction into the home switch: 1) Save value of Motor[x].pLimits, then set pLimits=0 2) Change Motor[x].CaptureMode=1 and Motor[x].CaptFlagBit=10 3) Set Motor[x].HomeVel=-10, then run home command 4) Set Motor[x].pLimits=saved pLimits value (re-enable hard limits) 5) Change Motor[x].CaptureMode=0 and Motor[x].CaptFlagBit=20 6) Set Motor[x].HomeVel=10, the run home command
Recommended Posts