Page 1 of 1

exit the executing c program for homing when Estop is pressed

Posted: Mon Feb 27, 2023 4:38 am
by ajith
Dear Sir,
I added c program for initiating the Gcode and External Emergency Stop button. when i am executing the C program for homing and Pressed the Emergency stop.it doesnot respond and continuing the execution of the C program.
Is there a way to stop the execution of any C program when the Emergency Stop button is pressed.
note: The Emergency stop button works fine when executing the G code.
Estop.PNG



Regards,
Ajith Arawinth

Re: exit the executing c program for homing when Estop is pressed

Posted: Mon Feb 27, 2023 10:31 pm
by TomKerekes
Hi Ajith ,

An ESTOP command should kill all Threads except Thread #1.

However once a Thread commands a Move the Move will complete regardless of whether the Thread is still running or not.

But then the ESTOP should disable all Axes so that should stop all Axes.

When the ESTOP_BIT is active the C Program will send continuous ESTOPS to KMotionCNC. Instead of sending infinite commands to KMotionCNC you might change your code to send only one. Or only send the command if the Axes are enabled.

So it isn't clear what is happening. Does the C Program stop? You can check which Threads are running on the KMotion C Program Screen. Running Threads have a green band.

Do the axes disable? You can see which Threads are running on the KMotion Axis Screen.