LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying a VI while another is running

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.

0 Kudos
Message 1 of 8
(1,235 Views)
Elements of what you propose are certainly possible with LabVIEW. The "trick" is to design your application to run simultaneous tasks "from the beginning", so to speak (although with good design, it is certainly possible to add an asynchronously-running sub-task that displays itself on, say, a second display monitor, or to have a sub-Panel on a second monitor that you can stick a variety of callable sub-tasks inside). There may also be other methods (I recall some Actor Framework demos that had some of this "flavor", but never got into Actors much, myself). I'm sure other members of the Community will have more experience along these lines ... Bob Schor
0 Kudos
Message 2 of 8
(1,222 Views)

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.

0 Kudos
Message 3 of 8
(1,204 Views)

"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.

0 Kudos
Message 4 of 8
(1,180 Views)

 


@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.

0 Kudos
Message 5 of 8
(1,166 Views)

@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.


"Should be" isn't "Is" -Jay
Message 6 of 8
(1,125 Views)

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

Download All
0 Kudos
Message 7 of 8
(1,057 Views)

@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?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 8
(1,040 Views)