Page 1 of 1

Timeout error

Posted: Sat Aug 27, 2022 2:59 pm
by cemoa9
Hello Tom,

On the lathe I use a ToolEye to measure the tools, C programs handle that, but in case the operator would like to stop the measurement before it is finished I implemented a button on the screen which set high the bit 1184 (not used) which is supposed to stop the axis and pause the thread, but it does not work properly, first KMotionCNC stops updating the position (but machine still moving), then it gives a timeout error and continues moving, if I press a second time on the button it finally works :

ClearBit(1184);

WaitNextTimeSlice();
Jog(0,1000);
while(ReadBit(Sensor))
{
if (ReadBit(1184))
{
Jog(0,0);
PauseThread(2);
}
}
Jog(0,0);
while(!CheckDone(0));


Is there someting I did wrong?

Cordially,

Francois

Re: Timeout error

Posted: Sat Aug 27, 2022 5:17 pm
by TomKerekes
Hi Francois,

I think the issue is that only 1 Action at a time can be in progress. If one button is configured to do the Measure and the action is configured to wait. And the other Abort Button is configured to do an Action to set the Abort Bit. Then the Abort will need to wait until the Measurement is complete. If it has to wait too long it will timeout.

Try configuring the Measure Action without the wait.

Alternately you might perform the Abort with a Momentary Button to set the Abort bit without performing an Action.

Please post program code with the code tags to be readable.

HTH

Re: Timeout error

Posted: Sun Aug 28, 2022 3:49 pm
by cemoa9
Hello Tom,

Surely works without the wait. (took some minutes to understand which wait you were talking about)

Thanks for your help, with that I just finished the work on it and will try to sell it, as promised I will share all the programs.

Cordially,

Francois

Re: Timeout error

Posted: Sun Aug 28, 2022 6:54 pm
by TomKerekes
Hi Francois,

Thanks for sharing and good luck!