Sarah83 Posted September 23, 2004 Report Share Posted September 23, 2004 Hi, I have a while loop in an other while loop. The inside have a button start over a loop tunnel. Now if I press this button the programm inside this loop should work and if I press the stop button I have linked to the loop inside this loop should stop. Now, I only press the run button from LV. It steps into my big while loop. Then, without pressing the start button of the other loop the programm steps in the small while loop Why? The value of the button should be false without pressing. And if I am in highlight modus I see a small f. If I press the start button in this modus I see a t. Here an image: Quote Link to comment
xseadog Posted September 23, 2004 Report Share Posted September 23, 2004 Hi,I have a while loop in an other while loop. The inside have a button start over a loop tunnel. Now if I press this button the programm inside this loop should work and if I press the stop button I have linked to the loop inside this loop should stop. Now, I only press the run button from LV. It steps into my big while loop. Then, without pressing the start button of the other loop the programm steps in the small while loop Why? The value of the button should be false without pressing. And if I am in highlight modus I see a small f. If I press the start button in this modus I see a t. Here an image: 1907[/snapback] Hi Sarah put your sub loops in case statements, control via front panel button/switch. chow xseadog Quote Link to comment
Sarah83 Posted September 23, 2004 Author Report Share Posted September 23, 2004 Hi Sarahput your sub loops in case statements, control via front panel button/switch. chow xseadog 1910[/snapback] Do I have a stop button in this case, too? Quote Link to comment
Jimmy-Chen Posted September 23, 2004 Report Share Posted September 23, 2004 Hi Sarah Are you sure the "INIT"step was execute? 1)Make sure the each while loop was exectue when you start the program. 2)Make sure the conditions(stop if true or continue it True) that you stop the while loop. 3)Make sure the butten Mechanical Active. Jimmy Chen Quote Link to comment
Sarah83 Posted September 23, 2004 Author Report Share Posted September 23, 2004 Hi SarahAre you sure the "INIT"step was execute? 1)Make sure the each while loop was exectue when you start the program. 2)Make sure the conditions(stop if true or continue it True) that you stop the while loop. 3)Make sure the butten Mechanical Active. Jimmy Chen 1913[/snapback] Yes, the INIT is execute 1 it is 2 stop when true is active 3 the mechanical action is everytime like your example image :headbang: Quote Link to comment
xseadog Posted September 23, 2004 Report Share Posted September 23, 2004 Yes, the INIT is execute1 it is 2 stop when true is active 3 the mechanical action is everytime like your example image :headbang: 1914[/snapback] Hi Sarah Noticed that in your image that you have a 'reset' ( top RHS)condition that will execute at some moment in time . Could that be causing a problem Also on your 'NIT'case, that case it is not wired. Is this just due to cropping of image or actual in your VI??? Try enclosing reset condtion in a case statement for debug purposes. chow xseadog Quote Link to comment
Sarah83 Posted September 23, 2004 Author Report Share Posted September 23, 2004 Hi Sarah Noticed that in your image that you have a 'reset' ( top RHS)condition that will execute at some moment in time . Could that be causing a problem Also on your 'NIT'case, that case it is not wired. Is this just due to cropping of image or actual in your VI??? Try enclosing reset condtion in a case statement for debug purposes. chow xseadog 1916[/snapback] Yes, but the reset is only working if the int is finished, after the reset case is activated and set some values blank. The INIT case is wired, if not, the programm couldn't step into this case, I think. You can't see the connection on this cutting. I replaced the while loops to case structures. But now I have the problem with the stop buttons Or is there a proberty where I can stop the case structure? Quote Link to comment
xseadog Posted September 23, 2004 Report Share Posted September 23, 2004 Yes, but the reset is only working if the int is finished, after the reset case is activated and set some values blank. The INIT case is wired, if not, the programm couldn't step into this case, I think. You can't see the connection on this cutting. I replaced the while loops to case structures. But now I have the problem with the stop buttons Or is there a proberty where I can stop the case structure? 1917[/snapback] Sarah what I meant was to enclose the while loops in case statements !! also try putting a wait pause with in loops so that CPU is not overloaded ie set wait time to 20 mSec chow xseadog Quote Link to comment
Jimmy-Chen Posted September 23, 2004 Report Share Posted September 23, 2004 I think you can use the Breakpoint to find the problem where they are... Jimmy Chen Quote Link to comment
Michael Aivaliotis Posted September 24, 2004 Report Share Posted September 24, 2004 Now, I only press the run button from LV. It steps into my big while loop. Then, without pressing the start button of the other loop the programm steps in the small while loop 1907[/snapback] Yes, this is normal. There is a rule in LabVIEW execution flow. ALL loops must execute at least once before they stop. This is because LabVIEW MUST iterate in order to read the value of the boolean and then it will decide that it should stop the loop from running a second time. If you don't want to run the loops at all, you must use a case structure around the FOR loop set to false. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.