LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Turn off "Run Continuous" in VI

Solved!
Go to solution

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 9
(2,203 Views)
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 9
(2,192 Views)

@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 9
(2,186 Views)

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 9
(2,182 Views)

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 9
(2,169 Views)

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 9
(2,153 Views)

You can turn of "Run Continuous" in VI by select file then Vi property then window appearance then select Dialog then OK.

0 Kudos
Message 7 of 9
(1,601 Views)

@binh1959 wrote:

You can turn of "Run Continuous" in VI by select file then Vi property then window appearance then select Dialog then OK.


I think you misinterpreted the original intent of the post, which was to stop continuous running, not hide the button.

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 8 of 9
(1,597 Views)

Yes, it can be done.  But I don't recommend it.

fes.png

Note: You can do crazy things with this.  Like faking that a running VI is not running; then edit the running VI (usually crashes LabVIEW).

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 9 of 9
(1,574 Views)