Page 1 of 1

KMotion freezing when trying to download C program

Posted: Tue Jun 30, 2020 7:36 pm
by amowry
I'm trying to download a C program in the C Program Screen in KMotion, and the application freezes. Any thoughts on why this would happen? There is already a program flashed to the same thread, but I assume that shouldn't matter, is that correct? It's on my K2CNC-- I'm trying to make a minor change to K2's main driver program and reflash to the same thread after testing it.

Re: KMotion freezing when trying to download C program

Posted: Tue Jun 30, 2020 8:07 pm
by TomKerekes
Hi amory,

I think K2CNC enabled a UserCallback. This causes KFLOP to continuously call the specified function every 90us regardless of whether the Thread containg the function is scheduled for execution or not. If you change the code in the Thread Space while the code is being called it will likely cause a crash. You must stop the callback first. Run StopCallback.c in a Thread other than the Thread containing the callback function first.

HTH

Re: KMotion freezing when trying to download C program

Posted: Tue Jun 30, 2020 8:19 pm
by amowry
That did the trick, thanks Tom!