LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Release called class from memory

I didnt get what do you mean?

0 Kudos
Message 21 of 33
(227 Views)

@D1140 wrote:

I didnt get what do you mean?


I mean, you will build this application and run TestApp.exe. PlugIns 1 and 2 can be loaded as expected. Now, I will open the development environment and change, let's say, PlugIn1 (it doesn't matter what - for example, change the caption). Then, I will build a new packed library with the changed PlugIn. Now, while keeping the application running, I will replace PlugIn1.lvlibp with my changed PlugIn and try to load it again. The new changed version will not be loaded:

Screenshot 2025-04-04 13.46.45.png

 

If I will restart whole app, then new modified PlugIn will be loaded as expected:

 

Screenshot 2025-04-04 13.52.19.png

But I would like to replace lvlibp and get it runnng without restart, that is.

0 Kudos
Message 22 of 33
(210 Views)

yes it is not loading during runtime. for the example you have to restart the exe.

To run the ppl you have to call is from other vi and closing that vi will release it from memory and than you can replace it during runtime.

And i want to do exact this but my ppl would be individual DQMH module. Do you have example for that ?

0 Kudos
Message 23 of 33
(196 Views)

You have to run the plugin in another VI hierarchy. When that goes idle, the class will be unloaded. At least that is what I gathered from listening to other people who do that. I am not a dynamic plugin person.

See for example this presentation by Matthias Baudot:

and this blog post by Sam Taggart: Dynamic Unloading of Classes (based on the video).
Message 24 of 33
(180 Views)

Unless something has changed significantly in one of the latest LabVIEW versions there is no way to unload a once loaded class from an application context, nada, njet, non!

You have to close the project and reload it.

PPLs only make the whole even more tricky! LabVIEW for some reason cross links even across application contexts when you load the same named PPL (but with different content, most prominently demonstrated with two PPLs compiled for different platforms). Once you got both projects loaded at the same time, by all means avoid saving anything to disk. Your project dependencies will get scrambled and sometimes beyond any repair!

Rolf Kalbermatter
My Blog
0 Kudos
Message 25 of 33
(134 Views)

Is there any other easy way to use ppls. Is there any frame work for PPLs ?

0 Kudos
Message 26 of 33
(112 Views)

If the ppl stays in memory does it affects performance ?

0 Kudos
Message 27 of 33
(99 Views)

@D1140 wrote:

If the ppl stays in memory does it affects performance ?


No, not unless you run out of memory. 🙂

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 28 of 33
(88 Views)

yes that only the impact right we might run out of memory because the functions and loops in ppl also using the memory. Data structure might also use the memory right. So if I dont release the ppl from memory, after its funciton being over. I might run out of memory. That may cause application crashing issues right ?

0 Kudos
Message 29 of 33
(86 Views)

@D1140 wrote:

yes that only the impact right we might run out of memory because the functions and loops in ppl also using the memory. Data structure might also use the memory right. So if I dont release the ppl from memory, after its funciton being over. I might run out of memory. That may cause application crashing issues right ?


It sounds right now like you are just idling around a bit with if's, when's, and but's and asking questions that are obvious to the one in the know and useless to the ones who don't know. What are your concrete problems? What hasn't been already answered in this thread that is worth talking about?

Rolf Kalbermatter
My Blog
Message 30 of 33
(78 Views)