Page 4 of 4

Re: Cancel a macro

PostPosted: Fri Apr 27, 2018 11:28 am
by Robertspark
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?

Re: Cancel a macro

PostPosted: Fri Apr 27, 2018 11:38 am
by ger21
Wouldn't this be a good application for a PLC?

Re: Cancel a macro

PostPosted: Fri Apr 27, 2018 10:43 pm
by Robertspark
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

Re: Cancel a macro

PostPosted: Thu Aug 16, 2018 10:57 pm
by audiokiller
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

;)

Re: Cancel a macro

PostPosted: Fri Aug 17, 2018 2:50 pm
by Robertspark
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

Re: Cancel a macro

PostPosted: Fri Aug 17, 2018 3:14 pm
by cncdrive
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.

Re: Cancel a macro

PostPosted: Fri Aug 17, 2018 3:26 pm
by ger21
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.

Re: Cancel a macro

PostPosted: Sat Aug 18, 2018 12:25 am
by cncdrive
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.

Re: Cancel a macro

PostPosted: Sat Aug 18, 2018 9:02 am
by Robertspark
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 ;)

Re: Cancel a macro

PostPosted: Sat Aug 18, 2018 11:15 am
by cncdrive
Since you can't safely kill terminate threads in Windows it is not possible to safely implement that.