LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

labVIEW: Control of sub-panes or windows by user?

Hi all,
 
I'm imagining a vi that, in addition to the regular front panel, has an 'optional' display panel. The user clicks a boolean on the front panel, and a separate display window opens. I'd like this window to be 'live' in the sense that it has indicators being updated from the main vi, and I'd like it to close by just re-clicking the same Boolean on the front panel. The reason for a separate window is that I usually don't want to see this data, or to allocate screen real estate to it. I'd like to be able to push this window around on my screen without also moving my main front panel.
 
I've been messing around with the window and execution properties of my subvi to try to make such a window, but the result has some problems. For one, I can't figure out how to close it other than the Big Red X (or to let the main vi know it has been closed). Also, the subvi seems to hog most of the execution time. I'm hoping that there's some clever way to do this.
 
Has anyone tried this?
 
Thanks in advance for any help,
 
Ed Pogo
 
 
0 Kudos
Message 1 of 8
(7,785 Views)
Hi

the execution time of the subvi is probably due to a missing wait (10..100ms) in a while.
Furthermore the subvi can check a global var that shows when it has to close itself and then can do so.

Are you calling it as a real subvi from the parent vi or are you using vi-server for this?
greetings from the Netherlands
0 Kudos
Message 2 of 8
(7,783 Views)
Hi Albert,
 
Thanks for the response. I'm using a real subvi, not a server subvi. I've never used Global Variables before, but they seem interesting. Are you suggesting that I eliminate the subVI altogether, and use the front panel of the global variable instead? That works pretty nicely, as far as timing goes. But, I still don't know how to make it disappear programmatically. 
 
I am intrigued by your comment that the subvi can check the global variable to actually close itself. Supposing that I have a boolean such as this in the global variable, where do I use this data? I don't know of any "shut down this subvi (or global variable) and make it disappear" node. 
 
Ed Pogo
 
 
 
0 Kudos
Message 3 of 8
(7,770 Views)
Hi

Do you have a simple example of your vi's so that I can look in which direction you are moving.
With VI-server you can start a vi without waiting to complete and if you pass a reference to that vi of the boolean that controls the stopping of the subvi you can keep the window as small as possible (no extra controls).
But a lot of other options are available as subpanels and shifting frontpanels.
greetings from the Netherlands
0 Kudos
Message 4 of 8
(7,767 Views)

Here are is my original scheme, before I started thinking about the Global variables. I had then and still have no idea how to close a window programmatically.

Ed Pogo

 

 

Download All
0 Kudos
Message 5 of 8
(7,762 Views)
Hi

This is the simplest way to make your subvi show or hide itself.
I had to reset some properties of the subvi itself and added the vi-server way to show or not show.

When the vi is not visible anymore you also should not call it, because that is work withou getting payed for.
I leave that to you.

greetings from the Netherlands
Download All
0 Kudos
Message 6 of 8
(7,751 Views)
Hi Albert,
 
Thanks for this code. The 'front panel open/close' node is pretty interesting. For closure, I'm calling the subvi if:
a. the main panel "open/close" button ever changes, OR
b. the window is already open, AND the data has changed since the last time the subvi was updated, AND at least 1 second has passed since the last update. Although the 1 Hz max update frequency makes the subvi a little choppy, it's not too bad.
 
I really appreciate your help.
 
Ed Pogo
 
0 Kudos
Message 7 of 8
(7,735 Views)
Hi

You could also add an enum to your subvi that selects a specific function in a case statement.
enums are perfect for these operations because they show up in the case title.

Best are typedef enums. You can create these by right click on the enum, select advanced/customize
and then in the control you got select typedef in the header, afterwards save this as a special control.
The nice thing about these typedefs is that if you have several of the same control and you update the typedef, all are updated.




Message Edited by Albert Geven on 01-19-2008 07:18 PM
greetings from the Netherlands
Download All
0 Kudos
Message 8 of 8
(7,733 Views)