Prevent one macro from starting while another runs ??

If you have a question about the software please ask it here.

Re: Prevent one macro from starting while another runs ??

Postby Dan911 » Sun May 06, 2018 10:28 am

Derek wrote:I'm pretty sure 2 macros can run at the same time if the second one is triggered via external button. At least that is what I experienced when I pushed the tool out button in the middle of a M6 being executed.


This is pretty much what I assumed the problem was related to when first read Terry's post and why my immediate thought was to address the macro's that is known will conflict with each other. I thought a
Ismacrorunning() function would cause more problems than help with the many scenarios with macro's running.

Possibly a Ismacrorunning(M6, M123) could help guard against known conflicts.
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Prevent one macro from starting while another runs ??

Postby ger21 » Sun May 06, 2018 11:59 am

Just add an LED and turn it on while the M6 is running, and don't allow the other macro to run if the LED is active?

Seems simple enough?
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Prevent one macro from starting while another runs ??

Postby Dan911 » Sun May 06, 2018 12:20 pm

Not knowing the specifics of the problem and what your trying to accomplish from start can make a thread like this go in many different directions.

I originally was under the impression these macro's were being called from a M6 call and the ATC triggered different switches at certain points that called different macro's/port pins.
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Prevent one macro from starting while another runs ??

Postby ger21 » Sun May 06, 2018 1:41 pm

Vmax549 wrote:Building a universal flag would solve teh problem.


How would that work?
10 different users might have 10 different macros running, with 10 different flags.
What if you want to allow some macros to run, but not others?

Seems like it would be very complex?

You'd probably have to select the macro, then pick the macros you don't want to run when that macro is running. But that also could get very complex, very quickly, for people with a lot of macros.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Prevent one macro from starting while another runs ??

Postby dezsoe » Sun May 06, 2018 1:58 pm

Hmm.

If you have a flag (or function) that will show that any macro is running, then it will be always true, because that macro is also running, where you check it.

If you want to disable some macros while a tool change is in progress, then check LED 28 (Toolchangeinprogress).
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Prevent one macro from starting while another runs ??

Postby Dan911 » Sun May 06, 2018 2:44 pm

Hi Dezsoe,

Clever point with a Ismacrorunning() function.

In all fairness the starting/subject of this thread had nothing to do with a M6 or tool change. The question was "How can you stop one macro from starting with another running".

With checking for a certain macro like I previously posted Ismacrorunning(M123) can be useful to some. It was pointed out in this thread 2 macro's running parallel to each other can conflict and cause problems.
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Prevent one macro from starting while another runs ??

Postby dezsoe » Sun May 06, 2018 3:17 pm

Hi Dan,

Derek and Terry wrote that they had problems with input triggered macro while M6 was running. That's why I pointed on LED 28.
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Prevent one macro from starting while another runs ??

Postby Dan911 » Sun May 06, 2018 3:20 pm

Yes, that led made me feel silly...never knew it existed. lol

Dan
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Prevent one macro from starting while another runs ??

Postby dezsoe » Sun May 06, 2018 6:02 pm

Hi Terry,

I think that turning off the LED when all macro stopped is not so complicated. My problem is, that IsMacroRunning() will always be true when you run a macro to check it. :) The needed function is IsOtherMacroRunning() and this would be very complicated. :)
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Prevent one macro from starting while another runs ??

Postby Dan911 » Sun May 06, 2018 7:07 pm

Vmax549 wrote:I cannot think of any reason to HAVE more than 1 macro running at a time. Excluding MacroLoops which should run outside and independant of teh main core.
(;-) TP


So what's the problem than ?? Have macro enable Led on start and off when it ends. Having a macro not start if Led is enabled you will only have 1 macro running at a time. Isn't that the reason for LED??

Am I missing something?
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

PreviousNext

Return to Ask a question from support here

Who is online

Users browsing this forum: No registered users and 36 guests