08-16-2013 05:07 PM
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!
Solved! Go to Solution.
08-16-2013 05:20 PM
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.
08-16-2013 05:21 PM
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
08-16-2013 05:26 PM
08-16-2013 05:36 PM
So what's your recommendation?
Put the set control values on the subVIs terminals and then make a bigger VIs?
Thanks
08-16-2013 05:43 PM
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.
08-17-2013 08:48 AM
@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
08-19-2013 08:56 AM
Thank you!
08-19-2013 08:56 AM
Thank you!