LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Remove or delete vi from memory

Solved!
Go to solution

I am running a vi which will run ok the first time I run it but doesn't execute correctly subsequent times.  If I close the vi (return to labview startup screen) and reopen it, then it works again.  The vi in question uses labpython to run some python code.  It is not possible for me to change this code, which is where the underlying bug must be located.

 

Is it possible to remove or delete a vi from memory similar to closing vi and returning to labview start screen?  I know this isn't elegant and will be slow, but it seems my only option.

 

I am using Labview 2009 SP1

 

Cheers

Ian 

0 Kudos
Message 1 of 11
(10,237 Views)

Ian,

 

the only real chance is using a dynamic call to this vi. You have to call it dynamically using VI Server.

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 11
(10,227 Views)

The problem you describe sounds like an initialization issue or race condition. Can you post the vi?

 

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 11
(10,206 Views)

so you want to open the subvi newly every time,if its this method is useful to you.

 

1.make right click on the subvi and select call setup

2.one list showing ,from this select "Reload for each call"

 

if you do,that subvi open every time newly in RAM...

 

 All the best

 

Raj
0 Kudos
Message 4 of 11
(10,193 Views)

Thanks for your reply.

I have tried this and it doesn't seem to work.

 

From the help I found:

Reload for each call—Loads the subVI when the caller VI makes the call to the subVI if the subVI is not already in memory. This option does not guarantee that the subVI stays in memory after the call.

 

This indicates that if VI is already in memory then it doesn't reload.

 

Cheers

Ian

0 Kudos
Message 5 of 11
(10,188 Views)

Hi Norbert,

I tried the dynamically load vi option.  The VI's appear to stay in memory even when VI reference is closed.

Solution didn't resolve my problem.

Cheers

Ian

0 Kudos
Message 6 of 11
(10,185 Views)
Solution
Accepted by topic author Ian_Phillips

Ian,

 

you have to make sure, that the VI is not active anymore (so use either "Call By Reference" node or set the parameter "Wait Until Done" to true for the "Run VI" invoke node, so both are blocking calls!) before closing the reference.

You can try a "Request Deallocation" after closing the reference.

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 7 of 11
(10,173 Views)

Still sounds like a USR or a FP Object not reinitialized to default.  Let's see the vi.


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 11
(10,164 Views)

Hi everybody,

Thanks for your help.

Problem solved.

I had an instance of the VI that I was trying to dynamically open hidden in a case structure, once removed it all works great.

I have attached a copy of vi for anybody else who may have similar issues.

 

Cheers

Ian

 

P.s. The Get vis in memory is a vi I found on the forum which is very useful.

Download All
Message 9 of 11
(10,152 Views)

Ian Phillips wrote:

P.s. The Get vis in memory is a vi I found on the forum which is very useful.


A quick peek at the VI Hierarchy view would have been usefull too since dynamically called vi's are not part of the heirarchySmiley Wink Right click and Find all instances gets you right to the BD with the vi highlighted.


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 11
(10,143 Views)