LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem when closing front panel dynamically

Dear Community,

Please bear on me not attaching code. I hope my description suffices.

I have a subvi whose front panel I close using the vi reference and and the method node "close front panel". After this method node I close the reference of the subvi using close reference.vi. The Problem I have is that when I run the program and end it I can not load the front panel of the subvi anmore. I get a blank screen. It is as if something got corrupted. My guess here is that this subvi is not closed properly thus causing the loading problem.

When I remove the part that closes the subvi dynamically from the subvi things return normal again.

Using LV 2018

 

 

0 Kudos
Message 1 of 7
(1,365 Views)

Closing the front panel nor closing the VI Reference (nor both) cause the VI to stop running.

 

It does sometimes, but not always. A VI is removed from memory (even when it's running) when there are no references to it. An open front panel counts as open reference.

 

My guess is that you get an error somewhere because of this (e.g. it's still running). You might get an error on the run method.


There are a lot of other things that can go wrong with dynamic VIs.

 

Use error handling. That should give you (and us) some insight.

Message 2 of 7
(1,334 Views)

You might want to try going into the "VI Properties" of the sub vi, under the "File" menu. From the pull-down menu in there, select "Window Appearance", then "Customize". Check the box that says, "Show Front Panel When Called" and "Close Afterwards if Originally Closed". Save the VI. I hope this works for you.

0 Kudos
Message 3 of 7
(1,268 Views)

 

JC4, that would be the straightforward way for me. BUT: I deliberately don't close the subvi (let's call it subvi1) when it's code is finished running because I need to see its front panel until another subvi (let's call this subvi2) is through. Subvi2 runs code and closes the front panel of subvi1 by using the property "close fornt panel". Then subvi2 closes. There are no other references to subvi1 in the programm. Still when I stop the programm and go into the block diagramm of subvi1, I get the blank front panel. Again, if i remove the reference of subvi1 from subvi2 then I don't get the behaviour I need, in return subvi1's front panel opens just fine.

I have worked my way into coping with this behaviour.

Thank you for your replies.

0 Kudos
Message 4 of 7
(1,238 Views)

You can use the "Close after call" but synchronize the two subvi's through e.g. a Rendevouz, so the fast one waits for the other to finish.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 7
(1,210 Views)

wiebe@CARYA wrote: prepaidcardstatus

Closing the front panel nor closing the VI Reference (nor both) cause the VI to stop running.

 

It does sometimes, but not always. A VI is removed from memory (even when it's running) when there are no references to it. An open front panel counts as open reference.

 

My guess is that you get an error somewhere because of this (e.g. it's still running). You might get an error on the run method.


There are a lot of other things that can go wrong with dynamic VIs.

 

Use error handling. That should give you (and us) some insight.


The Problem I have is that when I run the program and end it I can not load the front panel of the subvi anmore. I get a blank screen. It is as if something got corrupted. My guess here is that this subvi is not closed properly thus causing the loading problem.

 

When I remove the part that closes the subvi dynamically from the subvi things return normal again.

0 Kudos
Message 6 of 7
(1,185 Views)

@HappyCod wrote:

wiebe@CARYA wrote: prepaidcardstatus

Closing the front panel nor closing the VI Reference (nor both) cause the VI to stop running.

 

It does sometimes, but not always. A VI is removed from memory (even when it's running) when there are no references to it. An open front panel counts as open reference.

 

My guess is that you get an error somewhere because of this (e.g. it's still running). You might get an error on the run method.


There are a lot of other things that can go wrong with dynamic VIs.

 

Use error handling. That should give you (and us) some insight.


The Problem I have is that when I run the program and end it I can not load the front panel of the subvi anmore. I get a blank screen. It is as if something got corrupted. My guess here is that this subvi is not closed properly thus causing the loading problem.

 

When I remove the part that closes the subvi dynamically from the subvi things return normal again.


Our problem is that we can't really help without seeing any code.

 

All kinds of things could be wrong.

0 Kudos
Message 7 of 7
(1,174 Views)