Macro still running after hitting CYCLE STOP

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

Macro still running after hitting CYCLE STOP

Postby fdeporte » Tue Jul 23, 2024 11:50 am

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 ?
fdeporte
 
Posts: 22
Joined: Tue Dec 08, 2020 12:01 pm

Re: Macro still running after hitting CYCLE STOP

Postby dezsoe » Tue Jul 23, 2024 12:20 pm

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.
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Macro still running after hitting CYCLE STOP

Postby fdeporte » Tue Jul 23, 2024 1:01 pm

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 ?
fdeporte
 
Posts: 22
Joined: Tue Dec 08, 2020 12:01 pm

Re: Macro still running after hitting CYCLE STOP

Postby dezsoe » Tue Jul 23, 2024 1:11 pm

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.
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Macro still running after hitting CYCLE STOP

Postby fdeporte » Wed Jul 24, 2024 10:59 am

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 ?
fdeporte
 
Posts: 22
Joined: Tue Dec 08, 2020 12:01 pm


Return to Macros

Who is online

Users browsing this forum: No registered users and 14 guests