LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Turn off "Run Continuous" in VI

Solved!
Go to solution
Highlighted

I have a complex VI that needs to be run multiple times to iterate a solution. Right now, I hit the "Run Continuous" button and wait until it converges to a solution. I would like to be able to turn off the Run Continuous mode once I detect convergence within the program. Is this possible? I was looking at a "This VI" ref to an invoke node, but do not see an option here.

I don't want to trigger a "Stop" as I want the program to finish it's current iteration normally.

Yes, I could make a calling program, but there are too many variables etc. that would need to be wired into the connector pane.

 

Thanks for any suggestions.

0 Kudos
Message 1 of 6
(261 Views)
Highlighted
Solution
Accepted by topic author waynep

Hi,

 

Is there a reason to not enclose the whole vi in a while loop and use a stop button to stop the loop? The loop will finish its current iteration when the stop button is triggered.

 

0 Kudos
Message 2 of 6
(250 Views)
Highlighted

@TCChun wrote:

Hi,

 

Is there a reason to not enclose the whole vi in a while loop and use a stop button to stop the loop? The loop will finish its current iteration when the stop button is triggered.

 


Well, let's put it this way:

There is every reason to stop using the "Run Continuously" button as your solution, and every reason to use a loop, instead.  The "Run Continuously" button is only a debugging tool.  If used on anything other than a VI with the simplest architecture, it could lead to some unexpected results.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 6
(244 Views)
Highlighted

Yes, that is possible with my "converged" indicator stopping the loop. I will probably do that if there is no way to just turn off the Run Continuous mode from within the program.

The reason I am not doing that is I have a mode of operation that only needs to run once, but I suppose I could just stop the while loop at 1 run in that event.

 

But, I have become curious now whether it is possible to do what I asked. Perhaps, I may learn something following that path...

 

Thanks for the suggestion.

0 Kudos
Message 4 of 6
(240 Views)
Highlighted

If you need to run continuously until some condition is met you should use a while loop and exit on that condition. You should not be using the "Run Continuously" button.

0 Kudos
Message 5 of 6
(227 Views)
Highlighted

Thanks for knocking that dumb idea out of my head -- that is what I needed. I have already implemented the while loop and it (of course) works fine. I am not sure why I didn't do this initially as I have done the same thing many times in the past. Sometimes your thinking can get stuck in a certain direction and it takes some prodding to reset.

Another obvious reason to make the program self-contained is if I wanted to make an executable.

Message 6 of 6
(211 Views)