09-02-2022 02:23 PM
I would like to run a vi, and have it display another vi continuously while the first vi continues to run.
I want to use one vi that can capture and display trace data from a spectrum analyzer. Then I want to call that from another vi that performs tests. In some situations, I need to be able to see what's on the spectrum analyzer display. For example, if I'm running the test remotely. So I want to be able to click on a button to display the spec an capture vi continuously until I click on the button again, or the test vi ends.
09-02-2022 02:45 PM
09-02-2022 03:31 PM
That's an objective that has multiple ways to accomplish it, and it kind of depends on how complex you need the interaction between these two VIs to be.
At the simplest level, you would just create both of the VIs you want to run, and go into their "Properties" window, and set the "Window Appearance" options to "Top level application" on both, and then create a 3rd VI where you put both of those as subVIs to run in parallel.
If you need the VIs to send information to each other, you could use messaging systems such as Queues, Notifiers, or User events, depending on which makes the most sense for how the VIs are set up. You should strongly resist the urge to use global variables.
If you want to get more involved on how the VIs run at the same time, then instead of having one top VI calling the other two you want to run simultaneously, you could instead look into things like subpanels or asynchronous VI calls from whichever VI you use as the main VI.
The Actor framework that Bob mentions is in fact built on using asynchronous calls that send messages to each other using queues. It might be a bit much to learn it just for one small 2-window application.
09-02-2022 04:59 PM
"That's an objective that has multiple ways to accomplish it, and it kind of depends on how complex you need the interaction between these two VIs to be."
I would like to work just like it does in the development environment, when you have both vi's open, and you can see data going in & out of both vi's.
09-02-2022 07:00 PM
@bemoore wrote:
I would like to work just like it does in the development environment, when you have both vi's open, and you can see data going in & out of both vi's.
Is there something specific stopping you from doing this, then? Just make both of the VIs and run them both at the same time. It should be allowed in most cases.
If you already tried it and it doesn't seem to work for some reason, post extra details about which part isn't working and we can actually give specific advice that does apply.
09-03-2022 08:37 AM - edited 09-03-2022 08:40 AM
@bemoore wrote:
"That's an objective that has multiple ways to accomplish it, and it kind of depends on how complex you need the interaction between these two VIs to be."
I would like to work just like it does in the development environment, when you have both vi's open, and you can see data going in & out of both vi's.
So, you want to show the front panel of a subvi? All you need is a VI Reference to that vi and set the window appearance setting. You probably want it "Floating" to make it act like the Palettes. The Windows X will hide the panel without stopping the subvi.
09-07-2022 07:30 AM - edited 09-07-2022 07:38 AM
Hi bemoore,
I made some examples might fulfill your requirement.
Just try to run the Main.vi (LabVIEW version 2020)
There might be still a lot of bugs, but I would suggest you to do the following "click test"
Run "Main.vi" -> call SpetrumAnalyzer -> close SpetrumAnalyzer(hidden, running in the background) -> open SpetrumAnalyzer again
before you stop the Main.vi, don't forget to stop the subVI. If you understand the mechanism, you can put this idea in your own project.
If you are a beginner, I would suggest you go through the following basic topic of LabVIEW:
1. State Machine
2. Event handling
3. Reference handling, Invoke Node and Property Node.
Regards,
FrankenChino
09-07-2022 11:19 AM
@bemoore wrote:
"That's an objective that has multiple ways to accomplish it, and it kind of depends on how complex you need the interaction between these two VIs to be."
I would like to work just like it does in the development environment, when you have both vi's open, and you can see data going in & out of both vi's.
When you say, "Just like in the development environment," are you implying that these are to be built into separate executables?