From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

re-run vi in subpanel

I have an application where I'm want to run various tests in a subpanel. I apss in some variables to the VIs when I load them into the subpanel, and I want the VIs to then run. These are tests that run to completion and the called VI stops running. I then want the user to be able to modify the FP controls and re-run the VI. However, the reun VI method does not work, because the VI's execution state is "running", even though it is not running.

 

I have a "Run" botton in VI that contains the subpanel, and I can re-run the subpanle VI suing a call by reference node, but this forces the passed-in values to update, rather than allowing the user-supplied values to be used.

 

Is there a way to re-run a VI that is loaded into a subpanel?

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 1 of 5
(3,005 Views)

@littlesphaeroid wrote:

Is there a way to re-run a VI that is loaded into a subpanel?


You could just have a loop in the subVI to allow the user to input the values and then run the test.  It should then loop back to waiting for the user to tell it to run again or to stop.


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 5
(2,985 Views)

Thanbks for this udea, but that would require restructuring a template used across dozens of tests, to accommodate this very extrrnal issue. I need to run a VI whose front panel is loaded in a sub-panel. The test itself, in normal opration, only needs to operate once. A loop in the test code seems like a bad hack to accommodate a user interface trick.

 

This problem seems solvable. if not, my workaround is to abandon the subpanel and just open the VI's FP, but then that doens't fit in with the rest of my working subpanel system.

 

Reiteration: I pass in default values to a VI laoded in a subpanel, run the VI, which runs to completion and stops, and then I want to allow the user  to change the FP controls and rerun the VI. Is this possible using a subpanel? 

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 3 of 5
(2,975 Views)

Just wrap your existing subVI template into another subVI that includes the while loop and the features that Crossrulz suggests to add.

 

That way you don't change your existing code, but you've adapted it in a way that words for your subpanels.

0 Kudos
Message 4 of 5
(2,970 Views)

Hmm, let me think about this. I'm still not getting it. 

 

But why can't I rerun a VIU that's in a subpanel? Isn't it kindof like a VI whose FP is open. If I try the Run VI method, it fails with Error 1000 and shows the VI is running, even though it's idle. 

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 5 of 5
(2,960 Views)