From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open and close a vi front panel dynamically

I created a main vi panel that display all the signal names.  I like the main vi to open a new plot screen when I double click on the signal name.  I was able to do that using invoke node. But I when I close the plot screen by clicking on the Window "Close" button, the main vi was not able to open a new one again.  So I disabled the Window "Close" button and only use the "Stop" button coded in while loop in the blockdigram of the plot screen.  It worked, but the plot screen is still open and changed to editing mode.  Is there an easy way to close the plot screen by only one click.  Another question is that how does the main vi can open multiple plot screens.  Thanks for your advice.
0 Kudos
Message 1 of 16
(3,832 Views)
You can just add a small bit of code in this popup window that simply closes itself:


If you need to display this popup as multiple instances you can just make the VI reentrant. Or, you can save it as a template VI, but that would require more work.


Message Edited by smercurio_fc on 05-28-2008 01:51 PM
Message 2 of 16
(3,822 Views)
Hi Scott-D,
set "FrontPanel.open" to false before you close the reference. Can you upload your code or a picture of it? You can also use an event structure in your "signal" panel to react on the Window Close Button.

Mike
Message 3 of 16
(3,819 Views)
I agree, you should monitor for the 'Close action'.
What's the reason of the lockup?

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 4 of 16
(3,816 Views)
I think I know what happens:

If you close the front panel of a sub-vi, the code is still running, so the VI doesn't terminate and somehow you can't address it (it don't know how you communicate with your sub-vi).
So in your sub-vi you should monitor the panel-close event, and finish the code of the VI and finish the VI

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 5 of 16
(3,806 Views)
thank you all for your ideas and suggestions!  I'll try them out.
0 Kudos
Message 6 of 16
(3,786 Views)

I added the code and it worked just the way I wanted.  To make the VI reentrant, I went to the vi (plot screen) properties and checked on the box "Reentrant execution".  But it still doesn't work. Below is the code to call plotScreen.vi

 

0 Kudos
Message 7 of 16
(3,770 Views)
What, exactly, doesn't work?

Also, you actually posted a bitmap image, not a GIF, so you posted a 2MB file. If you had saved it as a PNG it would have been only 45K. Changing the extension does not "automagically" change the format of the file.
0 Kudos
Message 8 of 16
(3,768 Views)
A plot screen was opened sucessfully by a first time mouse click on one signal LED on the signal screen.  Then, from the signal screen, I click on another signal LED and I expected it opens another plot screen. But the code failed. an error message pops up "Error 1000 occurred at Invoke Node in DataAnalysisTool.vi (the signal screen)  Possible reason(s): LabView: The VI is not in a state compatible with this operation.  Method Name: Run VI        VI Path: C:\DAPlotScreen.vi"   I don't get what it means.
 
 
 
0 Kudos
Message 9 of 16
(3,760 Views)
Is there any handy tool that can be used in LV to save the blockdiagram so that it can be easily to post on the forum?
0 Kudos
Message 10 of 16
(3,754 Views)