LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help changing a run continuously VI into a run once

Hi,

 

I know that I am probably going to invoke the wrath of the labview gods with this request by not going through my tutorials again but I am unfortunately stuck and

getting a bit of a brain freeze on this one.

 

I have a VI for a flow meter, that runs perfect when I hit run continously but I need to add this to another VI that just runs once so I am trying to convert. 

 

I have had previous suggestions in another thread to replace the for loop with a while loop. Add a Stop button on the front panel and wire it to the Stop it True terminal in the loop.

Move the Waveform Chart and Flow Rate terminals inside the loop. I have done this but the VI does not run correctly, the dial just keep accumalating/adding and not resetting.

 

Any alternate approaches that I can try would be greatly appreciated.

 

Thank you.

0 Kudos
Message 1 of 7
(3,486 Views)

You also need to add a button to stop the counter task.  Then the next iteration it will be created again and should be reset.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 7
(3,478 Views)

Thanks, I have added a boolean switch and yes it resets when pressed manually, is there a way I can have it reset automatically for each iteration. I have added a revised VI.

0 Kudos
Message 3 of 7
(3,465 Views)

Hello Evan117,

 

for what I have seen, I can suggest you that instead of using 2 stop buttons you can use only one and create a local variable of that to wire it on the other loop, so you will only have one stop button.

Also, if you wire the "stop" input of the express vi this is what you are going to get:

 

Capture.PNG

 

 

Maybe you can follow the instructions and when you stop the loop by the stop button, you will automatically going to stop the express vi. 

 

Hope you can find usefull this comment, good luck!

0 Kudos
Message 4 of 7
(3,435 Views)

Evan,

 

If you only want the while loops to run once then just wire a "Equal to 0?" comparison to the "loop iteration" counter. The output will be true, which you can wire to the loop condition "Stop if true".

 

Is that what you need?

0 Kudos
Message 5 of 7
(3,432 Views)

I tried to do some cleanup and got away from that stupid Express VI.  Your loops really should be combined otherwise you have one nasty race condition with your local variable.  I also found a nice property node for the counter to reset its count.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 7
(3,428 Views)

Thank you for the suggestions, it is home time now so I will try these tomorrow, thanks again.

0 Kudos
Message 7 of 7
(3,413 Views)