08-16-2011 04:12 AM
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
Solved! Go to Solution.
08-16-2011 04:34 AM
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
08-16-2011 06:53 AM
The problem you describe sounds like an initialization issue or race condition. Can you post the vi?
/Y
08-16-2011 07:45 AM
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
08-16-2011 07:55 AM
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
08-16-2011 07:58 AM
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
08-16-2011 08:55 AM
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
08-16-2011 09:04 AM
Still sounds like a USR or a FP Object not reinitialized to default. Let's see the vi.
08-16-2011 10:12 AM
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.
08-16-2011 11:07 AM - edited 08-16-2011 11:07 AM
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 heirarchy
Right click and Find all instances gets you right to the BD with the vi highlighted.