I am using a C program to handle auto tool changes.
If the toolchange program is running and I hit the Halt or FeedHold buttons in KmotionCNC, the axes halt but the C program continues, resulting in the ejection of the tool from the spindle wherever it has halted on the table. Not ideal.
What code can I add to the toolchange program to test for Halt or FeedHold and exit out of the toolchange C program to prevent this from occurring?
Or is there a better way to prevent this situation from occurring?
Regards,
Laurence
Exit C program on Halt or Feed Hold
Moderators: TomKerekes, dynomotion
- TomKerekes
- Posts: 2529
- Joined: Mon Dec 04, 2017 1:49 am
Re: Exit C program on Halt or Feed Hold
Hi Laurence,
You can check if a Feed Hold has been commanded (Halt should also issue a feedhold) with:
if (CS0_StoppingState != 0) ...
You can check if a Feed Hold has been commanded (Halt should also issue a feedhold) with:
if (CS0_StoppingState != 0) ...
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Exit C program on Halt or Feed Hold
Thank you Tom,
That is just what I needed, I now have one more safety in place for my peace of mind.
Regards,
Laurence
That is just what I needed, I now have one more safety in place for my peace of mind.
Regards,
Laurence