LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Crazy while loop?



Halemani wrote:

 
you! My problem is that only. How do you stop the outer most loop?Smiley Mad


Change the architecture.  Try what I suggested and you'll see, it's faster to do and easier to understand and debug.  Forget about what you attempted, it's just going to cause you headaches..  😉
0 Kudos
Message 11 of 29
(1,302 Views)


@JoeLabView wrote:

Of course it will work.  The stop button then becomes a Stop Program button.  You can do one, two, three operatins, repeat them, etc until you press the stop (program) button.  You'd have 1 stop button and as many operations button as you need (three in this case).  And 1 single loop that is easily controlled.
 
The Event Structure is quite easy to implement.  And much cleaner solution.
 
RayR


Yeah, but in my case. There will be totally there will be 3 start, 3 stop and 1 program stop button. Then....yeah maybe I will try that.Smiley Very Happy
----------------------------------------------------------------------------------
I have still not got what I love.....
0 Kudos
Message 12 of 29
(1,300 Views)

I forgot to ask which version of LV are you using?  Because Event Structures are not part of the basic package 😞

Also, I am curious,  why do you need 3 start & 3 stop buttons?  Does it not stop automatically after doing what it has to do?  Can you elaborate?

RayR

0 Kudos
Message 13 of 29
(1,298 Views)
Hi Halemani,
if you press the stop4 button, you have to start and stop the other loops again, then it works for me. Smiley Happy
Here is an event structure example.
 
Hope it helps.
Mike


Message Edited by MikeS81 on 05-15-2008 02:25 PM
Message 14 of 29
(1,297 Views)


@JoeLabView wrote:

I forgot to ask which version of LV are you using?  Because Event Structures are not part of the basic package 😞

Also, I am curious,  why do you need 3 start & 3 stop buttons?  Does it not stop automatically after doing what it has to do?  Can you elaborate?

RayR



Ok, I have three charts I am sending my data. Then I will choose which chart to start showing data. Then I will choose to stop or start the other charts. Hence, 6 buttons for three charts(2 for each, start and stop). Then after I get bored I choose to stop the program.
How is it?Smiley Wink
Also, i have event case(LV8.0).


Message Edited by Halemani on 05-15-2008 07:32 AM
----------------------------------------------------------------------------------
I have still not got what I love.....
0 Kudos
Message 15 of 29
(1,294 Views)
Wow! Mike. Wait let me catch my breath! Why don't I think like you friend?Smiley Surprised
Thanks it did work. Although I need some time to understand the code.Smiley Very Happy
Thanks Mike babu and Ray babu(in India it means friend)Smiley Wink
----------------------------------------------------------------------------------
I have still not got what I love.....
0 Kudos
Message 16 of 29
(1,287 Views)

Glad you like it and thanks Mike for providing a vi.  No labview installed on my PC 😞

Try to adopt that structure... It will help you code more efficiently in the future. 😉

RayR



Message Edited by JoeLabView on 05-15-2008 08:44 AM
0 Kudos
Message 17 of 29
(1,282 Views)

Back to the original code

"Stop 4" is probably being read before the other loops run. If you put the "stop 4" button in a seq frame that is only executed afte the other three loops terminate, the button will be read AFTER the inner loops terminate.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 18 of 29
(1,267 Views)
No, Ben it won't work.
----------------------------------------------------------------------------------
I have still not got what I love.....
0 Kudos
Message 19 of 29
(1,245 Views)

Hi Halemani,

your are wrong in this point and Ben is right.
If you press the "stop4" button before you stop the last loop, it will work.
See the attached example. Smiley Happy However, I prefere the event structure method.

Mike

Message 20 of 29
(1,246 Views)