Break out of a While Loop ??

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

Break out of a While Loop ??

Postby Vmax549 » Mon Feb 26, 2018 9:34 pm

Anyone have an idea on how to break out of a while Loop other than shutting down UCCNC and restarting ??

esc does not work
cyclestop does not work
reset does not work

All the loops have a Thread.Sleep(10) So ESC should work BUT it doesn't

Yes I can write an escape function based on a timer(loop count) BUT that is not what I need for these loops.

These are loops waiting on an action. If that action never happens then you are stuck (;-)

(;-) TP
Vmax549
 
Posts: 913
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: Break out of a While Loop ??

Postby dezsoe » Mon Feb 26, 2018 10:32 pm

Check the reset LED in the while condition. That makes reset do the job. I have no idea for stop... :)
dezsoe
 
Posts: 417
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Break out of a While Loop ??

Postby beefy » Tue Feb 27, 2018 6:47 am

Why can't you add code in the while() loop, something along the lines of:

if (reset) // that's only pseudo code.
{
break;
}

OR:

if (Cycle Stop)
{
break;
}

Adds a little more overhead to your while() loop but if it's not affecting anything...................
beefy
 
Posts: 178
Joined: Mon Sep 05, 2016 10:34 am

Re: Break out of a While Loop ??

Postby Vmax549 » Tue Feb 27, 2018 12:48 pm

HIya Keith, In this instance I do not want uccnc to reset or cyclestop as it effects teh running of teh program. I am trying to figure out why ESC does not work. I have used esc before and it worked then. Same type loop different results :(

I'll let you know when I figure it out .

(;-) TP
Vmax549
 
Posts: 913
Joined: Sun Nov 22, 2015 3:25 am
Location: USA


Return to Macros

Who is online

Users browsing this forum: No registered users and 1 guest