06-15-2011 02:42 AM
Hi
I have used this method to close a vi and open another another one with a click but the problem is after closing the vi(inverting.vi) it remain still in memory so when I want to open it again I get a message somthing like it is in use or it is in memory.Would you please help me how can I close th vi properly or is there and easier way to close one vi and open another one at the same time
06-15-2011 03:07 AM
All you do is close the front panel of the VI. Unless it detects this itself and stops itself it will still be running in the background.
Without seeing its code it is difficult to say if simply aborting it is permissible, and whether this will unload it from memory. The best would be to send it a notification to stop itself gracefully.
06-16-2011 11:05 AM
Hello En99
I am an Application Engineer here at National Instruments and as I understand you are having problems with loading and closing vi's and their references. Here are some resources that may help you, if you still have problems, please get in touch and I will support you further.
Please feel free to ask any further questions.
Regards
06-16-2011 11:51 AM
From the help: on open VI reference
If you do not close this reference, it closes automatically after the top-level VI associated with this function executes. However, it is good practice to conserve the resources involved in maintaining the connection by using the Close Reference function to close the reference when you finish using it.
In the vi you opened you set "auto-dispose=T" so the non-inverting vi will leave memory when the vi exits. but you open a reference to inverting vi and close the FP BUT inverting vi remains in memory since the reference to the vi does not close until the vi in your jpeg leaves memory.
Put a close reference after the FP.close method.
03-31-2012 11:13 PM
So If I open dynamically subvi how described below:
and when close subvi how described here
Can I free up memory these actions after using dynamically subvi?
03-31-2012 11:16 PM
so I close subvi after using, this code I putted into last frame of subvi
04-01-2012 06:17 AM
As a note it's recommended in the help file to use Invoke node: FP.open instead of the property node as you do.
/Y
04-01-2012 10:32 AM
Dear Yamaeda
Please help me to evaluate my short example (see attachment) for 24/7's possibility and from point of view of unclosed references. In these subvi's I'm having plan to place databases subvi's. Can I run at once 5 subvi's and in every one there is event structure.
You are professional - your 4000 vi's are "for nothing does not pass" 8-) I'm very impressed
04-01-2012 02:21 PM
I didn't write all 4000 myself, it's an inherited platform with additions. 🙂
You overcomplicate some things and miss a couple of others. E.g. you have no way of stopping your sub vi's, using Abort is a BAD solution. You open and close the referrence each time, and also in the sub vi's. That's not necessary.
I've included a somewhat cleaned example, i use a global to stop the sub-vi's. It can be cleaned more.
Note that your sub vi's are running constantly, you only close/hide the front panel.
/Y
04-02-2012 11:51 AM
Attached as LV9