LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

close a vi from within another vi

Hello,
 
I have a vi which contains a table, when doucle clicking on a row in that table another vi opens with a waveform describing that row. this works fine only the user has to close the second vi every time before double-clicking on another row. It would be a hell of alot friendlier if the user could simply double-click the table and the waveform vi would update itself. I thought it would be simple to close the vi and reopen it but how could this be done ???
please help,
 
Yael
0 Kudos
Message 1 of 6
(2,750 Views)

You can do this, but you might need to change the way you work.

First, you can make the waveform a control instead of VI. That way, all it requires is updating.

Second, You can set the VI not to close its panel when its done. That way, it can do its work, display the waveform and stay open even after it's finished running and when the calling VI is ready for another click on the table. This is done in File>VI Settings>>Window Appearance>>Customize.

Third, you can run the display VI in parallel. For example, you can use a queue - the UI loop would enqueue a command with the data whenever you click the table and the display VI (which will be constantly running) will display the new data whenever a new command arrives in the queue. Check out the Queued Message Handler pattern in the File>>New dialog to see an example.

In the second and third case, you can set your window to be floating, so that the display is always there, even if the calling VI has the actual focus.


___________________
Try to take over the world!
0 Kudos
Message 2 of 6
(2,740 Views)

Hi,

Thanks for your reply, but I am not sure this is what i need. since parameters are transfered when second vi opens, and initializing all controls is done when its open, what I realy want is to identify the double-click, close second vi if it is open, and then open it with correct parameters.

Is this possible??

0 Kudos
Message 3 of 6
(2,732 Views)

Hi,

Thanks for your reply, but I am not sure this is what i need. since parameters are transfered when second vi opens, and initializing all controls is done when its open, what I realy want is to identify the double-click, close second vi if it is open, and then open it with correct parameters.

Is this possible??

0 Kudos
Message 4 of 6
(2,733 Views)
Hello,

Here is a quick example, I hope this will help you. this is just a basix use of the VI server.


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 5 of 6
(2,718 Views)
Here is my own simple example. Note that the VI does not close even though it finished running. Double clicking the listbox keeps calling the subVI with new values each time.

___________________
Try to take over the world!
0 Kudos
Message 6 of 6
(2,714 Views)