Dynomotion

Group: DynoMotion Message: 11167 From: tapiolarikka Date: 3/7/2015
Subject: Kill/PauseThread?
Hi Tom,

I tried to halt a stuck user thread with Kill(4) script command but the compiler does not recoqnize Kill.

I found Pausethread() from a thread in CNCzone. This works, but it looks that Pausethread is not mentioned in KFlop manual/list of script commands. You should update this :).

While testing this on Mach homing thread I found that my script works as I wanted as the user thread
is terminated.
To my surprise the axis kept on jogging. After second thinking that is no surprise as the homing issues a jog command and I terminated the thread before the stop command.

This brings up a safety issue suggestion: Should all motion commands be thread bound?


Meaning that if a thread that issues a motion command is terminated then motion is also terminated.


Rgds,

Tapio


Group: DynoMotion Message: 11170 From: Tom Kerekes Date: 3/7/2015
Subject: Re: Kill/PauseThread?
Hi Tapio,

Script Commands and C Functions and Variables are two different things although often there is a way to do something using either method.  See the KFMotionDef.h header file for avaiable C Functions and Variables.

In pretty much in any programming environment I think you should only force a Thread to terminate as a last resort as it is very difficut to guarantee everything is left is a coherent state.  Consider handling things differently.  Maybe have your homing routine detect some condition, stop any motion that it was involved with, and terminate itself.

Regards
TK