Page 1 of 1

Macro still running after hitting CYCLE STOP

PostPosted: Tue Jul 23, 2024 11:50 am
by fdeporte
Hi,
I am searching for managing scenario where Cycle stop are pressed or RESET.
I am coding my ATC macro and I don’t understand the behaviour when I hit Cycle stop button during macro running.
The move of axis are stopped but macro are still running.
I don’t understand why macro still running after I hit STOP. Can you please explain me ?

Re: Macro still running after hitting CYCLE STOP

PostPosted: Tue Jul 23, 2024 12:20 pm
by dezsoe
In most cases you have to handle the stop condition, so the macro will not stop. Normally, after each Code, Codesync or Codelist you have to check exec.Ismacrostopped() which will return true if the stop condition is set (the operation was stopped). Reset also generates a stop condition.

Re: Macro still running after hitting CYCLE STOP

PostPosted: Tue Jul 23, 2024 1:01 pm
by fdeporte
Thanks for your quick answer dezsoe !
So if the stop isn’t handle, all the following code still running ?
Does it means the STOP only stop the current line of code and continue after it ?

Re: Macro still running after hitting CYCLE STOP

PostPosted: Tue Jul 23, 2024 1:11 pm
by dezsoe
Yes, exactly.
If I can recall 2 of the mentioned functions will not execute code while the stop condition is active, but the third will clear the stop and try to run. You can find out which is which by a 2-line macro:

Code: Select all
exec.Callbutton(130); // stop
exec.Code("G0 X10"); // check if it runs

Replace Code with Codesync and Codelist to find which clears the stop state.

Re: Macro still running after hitting CYCLE STOP

PostPosted: Wed Jul 24, 2024 10:59 am
by fdeporte
I’ve investigate this morning. The functions code, codesync and code list aren’t executed after cycle stop.
However, a IF condition run after cycle stop.
It’s strange to have to check ismacrostopped in all IF condition, no ?