LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

run multiple programs in sequence

Solved!
Go to solution

Hello,

 

I have done 5 labVIEW program and they are not made into sub VIs.But I want to run all of these test one by one automaticlly.

Is it doable? These programs will share most of instrument. I did not make them into subVI since they have bounch of input setting.

 

Thank you!

0 Kudos
Message 1 of 9
(4,013 Views)

Basically any VI is a subVI. You can drop it onto a block diagram and it will call run that VI. Running them in a particular order is simply a matter of wiring data, often the error wire, from one VI to the next. Since LabVIEW is a data flow language any node will execute once all of it's input are available. A VIs outputs are not available until it has completed execution. So a VI (VI2) that has an input that is an output of another VI (VI1) will always execute after the first one (VI1) completes.

 

A more advanced way would be to use a sub-panel and load the front panel of the desired VI into the sub-panel and allow the user to interact with the data. You will still want to wire some data through all of your VIs that will be common. This will make it easier on the user. If you want to run them automatically with little or no user interaction you will need to connect the correct indicators and controls on the connector panes of your VIs.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 9
(4,001 Views)

1. To run them in sequence you will need to make subVIs from them or run them manually.

2. You can configure subVIs to open the front panel when called and close it afterwards. Another option is subpanels.

3. You will probably need to make some changes to the programs to behave nicely as subVIs.  I suggest that you make copies and edit those.

4. If the programs "share most of instrument" and that refers to some external instrument (as opposed to a LV virtual instrument), then there may be much better ways to set up your program. The instrument driver portion should be moved to subVIs which will be common to all the programs, but may appear only once in the master program.

 

Lynn

0 Kudos
Message 3 of 9
(3,999 Views)
You seem to have a very strange understanding of the difference between a VI and a subVI. Any VI can be a subVi simply by being called by another VI. Whether or not you have anything wired to the connector pane is irrelevant. To make it easier for execution flow, you should at least have error in/out terminals. If you are unwilling to do even that, then each VI can be placed in a frame of a flat sequence structure. You are of course aware that you cannot set control values or pass data from one VI to another with such a simplistic approach.
0 Kudos
Message 4 of 9
(3,997 Views)

So what's your recommendation?

Put the set control values on the subVIs terminals and then make a bigger VIs?

 

Thanks

0 Kudos
Message 5 of 9
(3,989 Views)

There are lots of answers to this question. Is someone going to be sitting there running this or will you be essentially starting it and letting it do it's thing? At a minimum you should consider at least wiring the common inputs and outputs through your VIs so that data can be set once and used by all of the subVIs. As both Dennis and I have stated all VIs are subVIs. Simply place it on to a block diagram.

 

Personally, I design my systems to have a separate UI task and the various processing tasks. I pass data between the various parts using queues, user events or a network connection. That depends on the specific task I am performing. You can't build a house by simply having wall pieces shipped in unless those wall pieces were specifically designed for the house. You are effectively trying to do that by taking multiple different VIs and simply throw them together to make a new application. Code needs to be designed to worked together.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 9
(3,983 Views)
Solution
Accepted by topic author tian66

@tian66 wrote:

Hello,

 

I have done 5 labVIEW program and they are not made into sub VIs.But I want to run all of these test one by one automaticlly.

Is it doable? These programs will share most of instrument. I did not make them into subVI since they have bounch of input setting.

 

Thank you!


All VI's are sub-vi's to the LV runtime. 😉

Just connect your controls/indicators to the connector pane, add error in/out and they're good sub-vi's. Make a new Main vi and drop and wire the current ones in that one. Done. 🙂

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 9
(3,955 Views)

Thank you!

0 Kudos
Message 8 of 9
(3,921 Views)

Thank you!

0 Kudos
Message 9 of 9
(3,920 Views)