LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory Management in Labview 5.1

Hi, I program a vi program for some laboratory measurement. it allows the user select which measurement he/she wants to do by selecting from a popup dialog when the program starts. But it seems tat, the vi loads all the different measurement vis into memory. what I want is that, when the user choose to do measurement 1, only the measurement 1 vi in the memory, otherwise, it just wastes memory.how can I do that?
Thank you!
I've uploaded a sample bg.vi there, hope that you can help me modify them to realize my dream. 🙂
0 Kudos
Message 1 of 9
(3,015 Views)
Hi,
you may use different vis from "functions/Application Control/..." to load VIs dinamically into the memory.
You have to use "Open VI Referenca.vi" to create the reference to the vi you want to load in memory and execute. Then "Call by reference node.vi" to execute it and then "Close LV Object reference.vi" to free memory after it completed the work.

I've created a new version of bg.vi.

Good luck.

Oleg Chutko
Message 2 of 9
(3,015 Views)
If the VI I need to invoke is within a llb file and the llb file , how can I specify the path? Thanks.
0 Kudos
Message 4 of 9
(3,015 Views)
Hi,
if vi "option1.vi" is located in "c:\users\myLV\test.llb" for example then the full path to vi is
"c:\users\myLV\test.llb\option1.vi"

Good luck.

Oleg Chutko
0 Kudos
Message 6 of 9
(3,015 Views)
just to clarify: If the vi loaded including some other subvis, will they be removed from the memory, when the vi is closed?
0 Kudos
Message 7 of 9
(3,015 Views)
> just to clarify: If the vi loaded including some other subvis, will
> they be removed from the memory, when the vi is closed?
>

If no other VIs are using them, they will leave memory immediately
following their caller.

Greg McKaskle
0 Kudos
Message 9 of 9
(3,015 Views)
Hello,

Oleg's suggestion to use VI Server would most definitely save you a lot of memory. If you are not familiar with the VI Server programming model, you may find it easier to use property nodes and invoke nodes instead of the Call By Reference Node. Take a look at the VI Server examples that ship with LabVIEW for additional information. I've attached a simple VI that demonstrates the basic flow of the VI Server model.

Regards,

Kent Leung
Applications Engineering
National Instruments
Message 3 of 9
(3,015 Views)
Can you compile it using Labview 5.1. I cannot open it, it says resources missing. Thanks
0 Kudos
Message 5 of 9
(3,015 Views)
Here's the recompiled version for LabVIEW 5.1

Regards,

Kent Leung
Applications Engineering
National Instruments
0 Kudos
Message 8 of 9
(3,015 Views)