exit the executing c program for homing when Estop is pressed

Moderators: TomKerekes, dynomotion

Post Reply
ajith
Posts: 65
Joined: Sat May 21, 2022 3:57 am
Location: TamilNadu

exit the executing c program for homing when Estop is pressed

Post by ajith » Mon Feb 27, 2023 4:38 am

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

User avatar
TomKerekes
Posts: 2676
Joined: Mon Dec 04, 2017 1:49 am

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

Post by TomKerekes » Mon Feb 27, 2023 10:31 pm

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.
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply