10-24-2019 07:44 AM
Hi, I have main vi with the queued message handler structure. It has a consumer loop that generates data and writes it to a global variable. The producer loop that has an event that opens a subvi window. In this window the global variable is read and its contents displayed.
Now, I would like if this subvi runs continously with its window open, but it should not interrupt the main vi, i.e. I should still be able to trigger other events from the main vi, while the subvi stays open.
The subvi should also not always stay on top as it is only used to monitor the global variable content.
Lastly, the subvi doesn't have any input or outputs, as the global variable is the only things that it reads from.
How can I do this?
Solved! Go to Solution.
10-24-2019 07:55 AM
Put the sub-VI in a sub-Panel within the Main VI. A sub-Panel is a "window" that you place on your Main VI's Front Panel. You resize your sub-VI's Front Panel so that everything you want "visible" is inside the sub-VI FP, and you then place a sub-Panel inside the Main's Front Panel, making it the same size as the sub-VI's FP.
You can learn more about this by using LabVIEW Help and searching for subPanels (no hyphens!), especially "Loading a Front Panel into a Subpanel". This also has an Example you can view.
Bob Schor
10-24-2019 09:06 AM
Yes, I know about subpanels. But on my main VI, there isn't enough space. Therefore I would like to have a separate window.
10-24-2019 09:24 AM
Well, it is time for you to compress the folder containing your LabVIEW files/Project and attach the resulting .zip file. Without seeing what you are doing, it is difficult to make suggestions and frustrating to have you say "Yes, but I don't like that suggestion ...".
Bob Schor
10-24-2019 09:58 AM
Here is a quick example I made of what I mean. The main VI is full of other things. I want to monitor something from a separate window. But once I open that window, the main VI becomes unresponsive until I close the subVI window. Note how you cannot change the boolean control with the monitor window open.
10-24-2019 10:41 AM
A subVI will always block whatever owns it until it has finished its execution. You will need to launch the VI and "forget it" which is done using VI Server calls.
Open the Example Finder and go to Programmatically Controlling VIs -> Dynamically Loading and Calling VIs -> Asynchronous Call and Forget. Instead of calling the subVI by just dropping it onto the block diagram, you create a reference to the subVI, then use a Start Asynchronous Call node to start the subVI running.
10-24-2019 10:50 AM - edited 10-24-2019 10:52 AM
I believe BertMcMahan has the right idea. I've attached a simple async vi call example that may help, but pretty much you want to launch the subvi without having it be blocking
It should be noted that the window will inherit whatever properties belong to the subvi, so if you set it to modal it will not allow you to click behind it, and so on.
You may also want to add a mechanism like a user event to programatically close out of the launched vi if necessary
10-24-2019 10:57 AM
@BertMcMahan wrote:
A subVI will always block whatever owns it until it has finished its execution. You will need to launch the VI and "forget it" which is done using VI Server calls.
Open the Example Finder and go to Programmatically Controlling VIs -> Dynamically Loading and Calling VIs -> Asynchronous Call and Forget. Instead of calling the subVI by just dropping it onto the block diagram, you create a reference to the subVI, then use a Start Asynchronous Call node to start the subVI running.
Thank you very much . This is exactly what I was looking for!