LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SubPanel fails to show if main panel is cycled on and off

If you run the VI i have attached, it will explain what I am seeing and I want to know why.

By running the 'test subpanel.vi', it will open a reference to another VI and trigger it to run and to be shown in the subpanel control. While the VI is running stand alone, anyone can control the timer that is shown in the sub panel control by either clicking stop and go for the timer. Once I make the running VI not open and then make it appear again, the sub panel control has lost the connection with the VI. The only way you can get it to reappear in the sub panel control is to resend another VI reference to it.

First, Why does this happen?
Second, is there a way to tell when this does happen (vi is not sho
wn in the subpanel control)?
Third, is this problem also in LabVIEW 7.1?

Any assistance would be great. I do have a work around if I have to... I will simply have to keep track of when I make the main VI open or not, and to resend the VI Ref to the subpanel control. If there is an easier solution, that would be appricated.

Thanks,

Kevin Shirey, PVI Systems Inc.
Kevin Shirey | CLA | Champion | Senior Project Engineer II | DMC
0 Kudos
Message 1 of 9
(5,459 Views)
I tried it in LV7.1 and the same thing happens. I would think that when you closed the front panel, the vi loses all its links to any sub panels, since the sub panel appears on the front panel. That is apparently what is happening, although it should not happen because the vi is still running. Your workaround sounds like a good solution.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 9
(5,459 Views)
Hi,

This appears to be a bug and is reproducible in LabVIEW 7.0 as well as in LabVIEW 7.1. I have reported it to LabVIEW R&D.

For now, I would suggest that you you the workaround that you suggested.

Regards,
Ankita A.
National Instruments
0 Kudos
Message 3 of 9
(5,459 Views)
I have the same problem, and the workaround is fine.
Is it better to send the reference of the subpanel to the insert VI node only once if the main VI FP is opened again or is it also ok to send the ref all the time, even if the FP is already open? By this, one wouldn't need to monitor if the FP state has actually changed to open state.
0 Kudos
Message 4 of 9
(5,459 Views)
Dirk,
For me, I see what you are trying to do, but you need to be careful to make sure you do not make duplicate references to a VI. For me, I built a VI to simply make a VI not visible, and if it equals the VI name of my front panel, I set a global to say redraw the subpanels. In the main panel, I have another loop running to continually read the global and if it tells me to redraw the subpanel results, I open a new reference to the subpanel VI and insert the reference and set the global to be false.

I do not know if there is any performance hit by continually inserting the VI ref to the subpanel node. Its been in my experience that if you let it run for a while, when it closes, each reference that was not explicitly closed will be close
d while LabVIEW exits. This can take some time as well as possibly crash labview if their are too many references to close. So in short, I would not send the reference continually for the reasons above. Best luck in programming!
Kevin Shirey | CLA | Champion | Senior Project Engineer II | DMC
0 Kudos
Message 5 of 9
(5,459 Views)
Kevin,
thanks for the comments. Yes, multiple refs are certainly an issue. Sometimes I feel not completely confident about the way I am handling this, so I attached a small VI (not fully functional) wich I believe is ok, reference-wise.

Dirk
0 Kudos
Message 6 of 9
(5,459 Views)
Dirk,

You may want to be careful with how you are handling the references. In order to automatically handle the subvi panel redraw, take a look at the example I sent. Basically, when the panel goes to a non-visible state, the next time it becomes visible, it will resend the reference to the subvi panel. This minimizes on relinking the SubVI Panel all the time and only relinks it when it is needed. Best of Luck!

In your example, you are assuming that the VI reference is not entirely changing, but it can. I always put references in shift registers in while loops. This handles the case that should the reference change, it will still use a valid reference. Also, you can not assume that the reference to your SubPanelVI
is still valid once the front panel closes. You shoudl reopen the reference to the SubPanel VI each time you decide to relink the control. Hope this helps.

--Kevin
Kevin Shirey | CLA | Champion | Senior Project Engineer II | DMC
0 Kudos
Message 7 of 9
(5,459 Views)
Kevin,

I thought that the VI ref is identified by a unique hex number, the one that you see using the probe on the ref wire. Unless if there is a special LV internal treatment of a reference in a shift register, I do not see why using the shift register in the lower while loop of your example would not produce the same error when the ref is as using just a simple input tunnel.
I would understand the behaviour if you would probe the property node inside the loop for an error and completely re-open the ref, if needed.
Perhaps I missed a point somewhere...
Anyway, thanks for the time you are spending on this 🙂

Dirk
0 Kudos
Message 8 of 9
(5,461 Views)
 

This was reported to R&D (# 3DT9KUG8) and was fixed in LabVIEW 8.0. Here is a link to the current evaluation software download for LabVIEW.

Thanks!

Travis H.
LabVIEW R&D
National Instruments
Message 9 of 9
(4,877 Views)