10-03-2016 08:34 AM
Greetings everyone, I would like to do a rather simple demonstration VI, that opens a menu where user can call a few VIs, signal generation, signal reading and graph analysis, each contained into a SubVI and with their own front panel and controls. The idea is user can just click a button and the required SubVI will load, I am using an event structure for ease.
Problem is, after I open any option, said SubVI hogs the execution thread, and doesn't allow for further instances until it's closed (it's inside a while loop so it makes sense I guess), the events queue and next front panel loads only after I stop the SubVI. I would like to be able to just open the front panels and let them run in parallel, without them waiting for another to finish, is this possible?
Solved! Go to Solution.
10-03-2016 08:57 AM
You'll want to do either an ansyncronous call or subpanels.
From what you've described here, it sounds like you'd prefer run subpanels so you don't end up popping up a bunch of windows.
10-03-2016 10:02 AM
natasftw is right.
A SubPanel is a "hole" in your main panel. You "insert" a separate VI into that "hole", and then you see the panel of the inserted VI thru the hole, and mouse clicks go thru the hole to the subVI below.
You have to run the subVI separately, though - just inserting it does not make it run.
An aynchronous call will start a subVI running, and then return to the calling thread with the subVI running in parallel.
You can then insert the subVI into a subpanel, or let it have its own window, as you choose.
There are examples showing both those techniques.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
10-03-2016 10:39 AM
You can check the example in this link :https://decibel.ni.com/content/docs/DOC-13956
This example shows how to use a producer/consumer design pattern with a queue to dynamically call multiple subVIs. The subVIs are called and then run independently of Main.vi. This means that they are running but Main.vi does not wait for them to finish executing before continuing (they are non-modal).
10-04-2016 01:51 PM
So yeah, asynchronous calls were exactly what I was looking for, thanks a bunch!