LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Load and Unload VIs and DLLs

Hello,

I am writing an application using Labview 7 in which my application is communicating to hardware.  I have a DLL written that actually handles the hardware communication (USB) and passes data into Labview.  The application is such that it only needs to communicate with the hardware occasionally, which is fired by an event structure.  One bug I've notice in the application is their is a very defined bringup sequence.  I first must turn on the hardware, then open the application for it to work properly.  If I bringup the application then turn on the hardware and "acquire data", it will not work.  A similar response happens when I power cycle the hardware while the software is open, once the power cycle is complete the application will no longer function.

The other day I thought to change all references to the subvi "Acquire Data" over to "Call By Reference Node" and closing the reference nodes after the acquisition in complete.  My thinking was that I'd load and unload the "acquire data" vi (and dll) from memory only when needed.  However, this does not seem to fix the problem when I build the application.  My questions are:

  • Is their anyway to monitor which vis and dlls are loaded in execution?  I'd like to verify it is loading and unloading properly?

  • Secondly, my top level application is structured in this manner (top level.vi->data acquisition sub vi->hardware sub vis->dll)  Currently I replaced all top level.vi references with the Call by Reference Nodes.  Is their a chance that when the data acquisition sub vi is called it is not releasing the dll when it is closed since the dll is called by hardware subvis.  Do I need to go into the acquire data subvi and replace all hardware subvis with Call by Reference Nodes (and close reference nodes). 

  • Finally, what are your thoughts of releasing and unreleasing the DLL at event trigger being the solution to my problem?


Many thanks.



0 Kudos
Message 1 of 3
(2,929 Views)
There is a property node Application.All VIs in memory. This Property Node will give you an array of strings with the name of each VI which is loaded.

If you use Open VI Reference the VI and all its subVIs are loaded. When you close the reference the VI and all its subVIs will be unloaded.

Because I don't have done any USB programming I cannot say by sure it will solve your problem. But it would be worth a try.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 2 of 3
(2,917 Views)

Hi Waldemar,

Thanks for the tip as I was unaware.  I tried it and it revealed a memory instance that I previously missed when I changed all subvis to references.  That's all it took.  After I changed that last memory instance to load and unload based off of an event, my program bug is fixed.


Thanks again.

0 Kudos
Message 3 of 3
(2,909 Views)