Hi,
I'm sure there is a simple answer to this, but I haven't been able to find a discussion that relates to this question. The question is in regard to my Kflop C programs that Jog to a external signal such as a probe detection. For a probe Jog, my while loop implements a timeout along with the ReadBit for the probe input. For a probe Move, there is also a check for an unexpected probe trigger as well as a timeout. These goes a long way in protecting the probe from a bone-headed operator (that being me).
The reason for the timeout in the Jog while loop is to handle the probe missing its target. In the Move, the timeout is mainly used to exit the while loop if a limit is hit .
I'd like to be able to directly check for hitting an axis limit switch or soft limit. Is there a way to pole for the axis being stopped due to hitting a limit or anything else that can stop the motion during a Jog or a Move?
I'm using version 4.3.5f
Checking for axis limit hit during Jog or Move
Moderators: TomKerekes, dynomotion
Checking for axis limit hit during Jog or Move
Thanks,
Larry
Larry
- TomKerekes
- Posts: 2741
- Joined: Mon Dec 04, 2017 1:49 am
Re: Checking for axis limit hit during Jog or Move
Hi Larry,
Depending on Limit Switch Options a limit switch may trigger a Feed Hold or it may Disable the Axis. Soft limits will trigger a Feed Hold. You might just check for either conditions.
For Feed Hold you can check this for non-zero
For an Axis disabled you can check axis Enable status: ie
There shouldn't be any other normal cases where motions stops except for something extreme like power turned off, amplifiers disabled, EStop, Axis Configuration changed, etc.
HTH
Depending on Limit Switch Options a limit switch may trigger a Feed Hold or it may Disable the Axis. Soft limits will trigger a Feed Hold. You might just check for either conditions.
For Feed Hold you can check this for non-zero
Code: Select all
extern int CS0_StoppingState; // emergency stop in progress, 0 = not stopping, 1=stopping coord motion, 2=stopping indep, 3=fully stopped, 4=ind stopped
For an Axis disabled you can check axis Enable status: ie
Code: Select all
if (!ch0->Enabled) ....
HTH
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Checking for axis limit hit during Jog or Move
Excellent, I will check for both. Thank you very much Tom and thank you too for replying so quickly!
Larry
Larry
Thanks,
Larry
Larry