Page 1 of 1

Intermittently no execution

Posted: Fri Dec 13, 2019 7:57 am
by ZooBDoo
I've been experiencing intermittent non-execution of a C program when using the compile/download/execute button on the C program screen. It's an init program and it may have just been running just fine but was halted to diagnose another problem. I'm not exactly sure when it stops executing but I push the Compile/dnld/exec button and nothing happens. No compile errors, nothing. I'm still not quite sure if the button isn't commanding it to download and execute but that's what it's acting like. I'm in the process of inserting a number of printfs in the code to watch it on the console.

I'm running a laptop with Win 10 with a USB isolator on the USB-C port.

Any ideas?

AZ

Re: Intermittently no execution

Posted: Fri Dec 13, 2019 6:34 pm
by Moray
You say you're not sure why the program stops executing, and it had been halted.
Do you mean something in the code halted the execution, or did you manually halt the execution?

If you issue a halt command to the KFlop, it will halt all threads (or if running KMotionCNC, thread 1 should remain active)
If something within your program is issuing the halt command, then unless you've cleared whatever condition has issued that halt, as soon as it is redownloaded/run, it can immediately halt again, and give the impression nothing has happened.

If you post up your C program, we can have a look at it, and see if there is any obvious issue.

Re: Intermittently no execution

Posted: Fri Dec 13, 2019 8:00 pm
by ZooBDoo
I found that the program was actually downloading and running but I saw no response from the motors because of an intermittent power supply to the SnapAmp caused by an intermittent pin in a connector. Sorry for the distraction.

AZ

Re: Intermittently no execution

Posted: Fri Dec 13, 2019 8:09 pm
by Moray
For future reference, if you're unsure if a thread is running, look at the thread buttons down the right hand side of the C Program screen in KMotion, as their background will turn green if they have an active thread running.