Timeout error

Moderators: TomKerekes, dynomotion

Post Reply
cemoa9
Posts: 82
Joined: Mon Jun 01, 2020 11:01 am

Timeout error

Post by cemoa9 » Sat Aug 27, 2022 2:59 pm

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

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

Re: Timeout error

Post by TomKerekes » Sat Aug 27, 2022 5:17 pm

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

Tom Kerekes
Dynomotion, Inc.

cemoa9
Posts: 82
Joined: Mon Jun 01, 2020 11:01 am

Re: Timeout error

Post by cemoa9 » Sun Aug 28, 2022 3:49 pm

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

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

Re: Timeout error

Post by TomKerekes » Sun Aug 28, 2022 6:54 pm

Hi Francois,

Thanks for sharing and good luck!
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply