From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Using VI Server for Front Panel Control

How do you not show a sub-vi front panel when first loaded, yet be able to display it later when called? I downloaded the vi example from NI titled "Displaying a SubVI or Global Front Panel on User Command." This should answer my question, but it's not clear how to implement it in my particular application. The primary thing that’s unclear is where to put the VI server code and were to put the initial data loading code.

For example, I have a main vi that uses two sub-vi's. The system uses the first sub-vi to setup test parameter data. The second vi is used for data acquisition and is reliant on data in the first vi. I do not want the first vi to present its front panel automatically when the second vi is called.
However, for operator convenience, I would like to display the fist vi front panel when manually called (within the second vi).

Any attempt to set the VI Properties >> Windows Appearance in combination with the SubVI Node Setup seems to lock up the program.

I’m missing the point somewhere. Please advise…

(If needed, I can download the program example.)
0 Kudos
Message 1 of 5
(2,724 Views)
Try attached example ...

Hope I understood what you are trying to do

p.s.: if you have many parameters, you can use control references to avoid having them duplicates (in both VIs )
Download All
Message 2 of 5
(2,723 Views)
Thank you for your response. This nicely answers my questions. Of course I have additional questions. I made some changes (attached) for the following reasons:

1. The first vi is placed in main because the main.vi will need access to it.

2. Moved the Parameter node inside the while loop and added the initial sequence structure so the parameter data is retentive when the first.vi is restarted.

Why was the Parameter and Data nodes inside the sequence structure in the original version?

3. The default input to the first.vi was deleted when the Second.vi is called. I'd like the Main.vi to handle the loading of defaults in this part of the program.

Eventually, I'd like to have the parameter data stored in a file so the operato
r can save and retrieve it as defaults. Do you have suggestions on how this is done or do you know of any examples I can look at?

The above has been implemented in the program and it seems to work well. However, when the Second.vi is called by the Main.vi, the First.vi front panel flashes on twice and promptly goes away. I've tried to squelch it to no avail.

Something is causing the First.vi to briefly become visible (twice) when the Second.vi is called. Any ideas?

Thanks,

Dave J.
Download All
0 Kudos
Message 4 of 5
(2,723 Views)
I would use a reference to the other panel. You can control whether the panel is open using a property node. I have included a little example here. Just run the "Main" vi and the controller VI will show up. It's pretty self explanatory from there (I think). Have Fun.

Rob
0 Kudos
Message 3 of 5
(2,723 Views)
I remade the VIs following your new explanations (the first version was mainly to show how to manage the windows, not for parameters because it really depends on your app specifics from this point of view).
Anyway, I think this one is much better and it allows you to manage parameters easier. MAIN calls FIRST and FIRST calls SECOND after loading default values from file.
If you need to run the 1 and 2 separately, use VI server's "Set Control Value" method.
Regarding the values storage into file, you have several options: saving as text, binary, using configuration files or even the registry ... it's your call. Take a look in lv folder\examples\ or search on NI's site.



Good luck !

p.s.:
- regarding the sequence, it was probably just
to force the dataflow
- regarding the FP flash, I couldn't notice on my computer ... maybe you set the FP to open when called
Download All
0 Kudos
Message 5 of 5
(2,723 Views)