04-06-2009 05:04 AM
Hello,
On upper picture is simple setup of my program. When I click on left button, in right grey area another VI runs. When this subVI stops it remains in this grey area of main VI.
My question seems simple 🙂
s it possible that this secondary VI is not visible when it stops, so that grey area would apear again 🙂
04-06-2009 05:23 AM - edited 04-06-2009 05:23 AM
Hi,
There are few ways to close the VI when its execution has completed:
1. Right click on the subvi>>subvi node setup>>enable the options "Show front panel when called" and also close after originally closed.
2. Use the invoke node as shown below within the called subvi finally so that the FP closes after execution
3.Use the property node as shown below for same action
Hope this helps.
04-06-2009 05:56 AM
Thanks JK1, I tried some of these methods but still I didn't managed this.
Below is screenshot of Block Diagram. I am not sure where exactly to put the codes you gave me, since subvi's are not actually in main VI, they are rather called, as you can see from block diagram.
http://img25.imageshack.us/img25/4016/12314204.jpg
I hopeproblem is more clear now 🙂
thx for your time again
04-06-2009 06:01 AM
FP.Close should be placed within the called Sub vi. I think you have placed it in caller and hence it did not work.
Place it in the subvi that is called dynamically by the parent vi.
04-06-2009 06:39 AM - edited 04-06-2009 06:41 AM
I checked in SUBVI's and they are both correct regarding closing after completion. So it must be something in this main VI that I am missing...
This is written in part 6. of main VI block diagram:
" Close the VI Reference and check for errors. The front panel of the selected VI remains visible while the main VI runs, even after you close the VI reference."
Perhaps something can be added here that can KILL 🙂 subvi completelly
04-08-2009 10:42 AM
Hello,
Is it possible to post your VI so that I could try running it? I cannot see what's happening in your event structure, but it is important to note that if this loop runs multiple times, then only the last (most recent) VI reference will get passed to the FP.Close Invoke node because you are using a shift register. So previous instances of your subvi will not be passed to this function.
Regards,
Anna K.
04-09-2009 02:39 AM
Here is VI. Note that another two VI's are connected as you can see in block diagram to main VI. problem is how can I program main VI so they are completelly closed after they are finished.
04-13-2009 01:44 PM
Hello,
I ran the code and made one small change, wired a -1 to the tunnel of your event structure in the Exit Programs event so that the True case of your Case Structure does not run again when this event occurs because this can throw an error when trying to Run an already running VI. When I click Exit Programs, the page where the SubVI appeared goes grey just like you mentioned so I may not understand exactly how the behavior we want is different than what we have here. Could you maybe outline the use case that causes the wrong behavior?
Regards,
Anna K.
04-13-2009 02:32 PM
Short Name: Insert VI
Installed With: Full Development System
Class: SubPanel Methods
Loads a VI in the subpanel control without changing the state of the VI.
If the front panel of the VI you want to load is open or if you loaded the front panel in another subpanel control on the same front panel, LabVIEW returns an error, and you cannot load the front panel in the subpanel control unless the front panel is reentrant. You also cannot load the front panel of a VI in a remote application instance, and you cannot load front panels recursively.
After you use this method, the front panel is in memory. Use the Close Reference function to close the VI reference. The front panel remains in the subpanel control until you stop the VI that contains the subpanel control. You also can use the Remove VI method to unload the VI in the subpanel control.
Simple answer
04-14-2009 05:13 AM
Thanks Anna and Jeff.
Anna it is true that "When I click Exit Programs, the page where the SubVI appeared goes grey". Whole idea is that these subvi's must end immidiatelly after theay are done, not when I press Exit Programs button! Still working on this