LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to programmatically remove VIs from memory?

Yes, the basic idea is to use a local variable of the input to reset its contents to empty after the code has convert the data into the lv datatype. That way when the defaults get saved, the variant input will be empty.

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 21 of 30
(1,996 Views)
I solved it in a more straightforward manner.  In make_current_values_default, I added another Set Control Value function after the VI has been run.  It enters a blank variant constant into the Data In variant terminal.  THEN the default values are saved.
0 Kudos
Message 22 of 30
(1,993 Views)

Yup, even better...

Given any thought to building a program to build the templates and what not for your users? If your boss likes what you have so far, do that and he'll think you walk on water! Smiley Very Happy

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 23 of 30
(1,990 Views)
He seemed quite pleased with the current incarnation, and requested that I move on to another project.  I'd previously created an importer that reads data from a WaveMetrics Igor(TM) binary wave file (.ibw) and now I have to write a program that can go the other way as well.  All in addition to my real research project.  I may eventually come back to DataVIew in the future, but for now they'll have to be satisfied with the exhaustively in-depth step-by-step guide I wrote concering the procedure for creating new templates.
Message 24 of 30
(1,979 Views)

Sorry did anybody answer the question "Is there a way to programmatically remove VIs from memory?"?

 

0 Kudos
Message 25 of 30
(1,345 Views)

@Frankmesa wrote:

Sorry did anybody answer the question "Is there a way to programmatically remove VIs from memory?"?

 


"Request deallocation", but it'll only remove VI's which are no longer referrences by any active VI.

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 26 of 30
(1,327 Views)

Request deallocation is used to deallocate unused memory, not to unload VIs. I can't think of any programmatic way of unloading VIs other than loading things dynamically and then correctly stopping everything and closing all the relevant references.

 

That said, I didn't read through the whole threads, but the original question was asked about LV 7.1 and apparently VITs, which might be completely irrelevant today, since handling VIs has changed a lot. I would suggest you start a new thread and ask a full question explaining what you want, just like the OP did in this thread.


___________________
Try to take over the world!
0 Kudos
Message 27 of 30
(1,321 Views)

Hi there,

 

I understand the usage of request deallocation thanks to you.

But instead of having it in each of my VIs, I need to remove the unused memory from a single main VI.

I wll also let you know my main purpose and the exact problem I am facing. My application will issue calls to different main VIs and most of them are named "Main.vi" itself.

The problem I am facing is each time I issue a call to a main vi an already loaded "Main.vi" is referred irrespective of the VI I am calling. I need to remove the memory and instance of any of the VI when I am done with it.

 

Thanks,

Shameel

0 Kudos
Message 28 of 30
(1,256 Views)

@shamerox wrote:

The problem I am facing is each time I issue a call to a main vi an already loaded "Main.vi" is referred irrespective of the VI I am calling. I need to remove the memory and instance of any of the VI when I am done with it.

 


What exactly do you mean?  What specific problem are you having that makes you want this?

0 Kudos
Message 29 of 30
(1,240 Views)

@shamerox wrote:

I understand the usage of request deallocation thanks to you.


Apparently you don't, because what you want is not to release memory. You want to unload the VI, so that you can load another one with the same name, and for that, like I said, you need to properly close all the references. Even then, I'm not sure exactly when everything is released, because I never had a situation when I had to repeatedly load different VIs with the same name, so I never looked into this.

 

Usually, if VIs have the same file name, they will be added to a library, so that their fully qualified name (the one that LV actually uses to identify VIs uniquely in memory) is different. If you can, I would suggest you do that.


___________________
Try to take over the world!
0 Kudos
Message 30 of 30
(1,231 Views)