Cancel a macro

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

Re: Cancel a macro

Postby Robertspark » Fri Apr 27, 2018 11:28 am

Derek wrote:
But why are you relying on software to protect or hold your tools?


The same reason I'm relying on software to machine my cylinder heads. Trust.

Derek



Thats not quite what I was on about.... that is an operation.

My point was why not design your interlock to be physical or two stage. If a probe was to "fall out" under loss of signal, what would a tool do if power was lost during a cutting operation.... would it fly across the machineshop?
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Cancel a macro

Postby ger21 » Fri Apr 27, 2018 11:38 am

Wouldn't this be a good application for a PLC?
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Cancel a macro

Postby Robertspark » Fri Apr 27, 2018 10:43 pm

Uccnc is good, but don't forget the price point.

I don't believe it will ever be able to complete with the big boys, but then it's unlikely that you'll pay for a family car and end up with a sports car, even if it's trying. There are always compromises to be had.

The catch for uccnc is just to keep its eyes on the competitors offerings and exceed their provision although provide simplicity.

Litigation is the world over... And only the lawyers get rich... But then you have class action.. we don't here... Your payouts are bigger, as ours are claim award plus costs (or part of) where as yours need to include litigation costs. Rule #1 take out professional indemnity insurance
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Cancel a macro

Postby audiokiller » Thu Aug 16, 2018 10:57 pm

I have a similar issue trying to stop a macro that shows several messages on the screen and the Status window.

If I press stop or esc at any point, the movement will stop, but the macro continues to showing me all the messages thru the end of it.

I Fix it with a lot of if(!exec.Ismacrostopped())

Bu i think the macro should stop completely if press the Esc or the stop button

;)
audiokiller
 
Posts: 1
Joined: Wed Aug 15, 2018 4:44 pm

Re: Cancel a macro

Postby Robertspark » Fri Aug 17, 2018 2:50 pm

But did you not create the macro?

It just sounds like a poorly constructed macro, if you would like some help loads of us have experience and offer assistance.

Instead of asking to change things

Post the macro and tell us what it's purpse is and what you want it to do.

If it were me, I would create a macro loop that checked and set a flag and within the macro make it check the flags

If you really want the ESC key to do something set it up within a macro loop to check for the ESC key and return from the macro / break if the ESC flag is set.

Why change it universally? Affecting how many uccnc users who are happy with the current setup / or unaware of an apparent issue
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Cancel a macro

Postby cncdrive » Fri Aug 17, 2018 3:14 pm

Doing it would possibly make things as buggy as in Mach3.
I think many bugs in mach3 are because they killing threads. It is unrecommended to do that in Windows programming, because the results are indeterminable.
The proper way is always to quit the thread controlled and with the macros the only way is to check for the flag in the macro and not doing things if the flag became set.
I know it is more code, but it is at least safe.
cncdrive
Site Admin
 
Posts: 4887
Joined: Tue Aug 12, 2014 11:17 pm

Re: Cancel a macro

Postby ger21 » Fri Aug 17, 2018 3:26 pm

Doing it would possibly make things as buggy as in Mach3.
.


Yes. In Mach3, if you stop a macro, I recommend always restarting Mach3 immediately, or strange things can happen when you run another macro.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Cancel a macro

Postby cncdrive » Sat Aug 18, 2018 12:25 am

No, ESC does not kill any process, it just sets the ismacrostopped flag. The user can handle it if he wants or not...
There are a few things which we disable on macro calls if the ismacrostopped flag is set. We could disable more, but we already disabled those what we thought that are important.

I also worked with mach3 for years and I saw that when a macro was killed then mach3 often became instable and I'm sure it is because threads did not exit properly.
Killing threads in Windows programming is like playing Russian rulette, the thread may die or not, it is not guaranteed at all that it will die.
cncdrive
Site Admin
 
Posts: 4887
Joined: Tue Aug 12, 2014 11:17 pm

Re: Cancel a macro

Postby Robertspark » Sat Aug 18, 2018 9:02 am

With micro controllers you use a "watchdog" timer, which with CNC is the same as a charge pump essentially with CNC.

Would it therefore not be good practice to design those macros that need to operate / continue to operate using a similar proceedure (as discussed keeping track of / checking a flag periodically)

...just a thought on good practice for design ;)
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Cancel a macro

Postby cncdrive » Sat Aug 18, 2018 11:15 am

Since you can't safely kill terminate threads in Windows it is not possible to safely implement that.
cncdrive
Site Admin
 
Posts: 4887
Joined: Tue Aug 12, 2014 11:17 pm

Previous

Return to Ask a question from support here

Who is online

Users browsing this forum: No registered users and 19 guests