12-23-2009 08:28 AM
Hi,
I am trying to load a VC++ DLL (with two threads) in LabVIEW . Is it possible to maintain the DLL "ALIVE" in memory or it will be loaded in memory only when I am calling the DLL function??
Please provide your comments.
Thanks in Advance.
Regards,
Sathish kumar D
12-23-2009 09:53 AM
Hi,
If the dll is not releasing it's memory, then it's "alive" until you close LabVIEW. At the other hand, if the dll releases it's memory it will be unloaded immediately.
Since you dll has two threads get sure to check the "run in any thread" option when configuring the Call Library Function Node.
Christian
12-24-2009 01:35 AM
sathish.deena@hcl.in wrote:Hi,
I am trying to load a VC++ DLL (with two threads) in LabVIEW . Is it possible to maintain the DLL "ALIVE" in memory or it will be loaded in memory only when I am calling the DLL function??
Please provide your comments.
Thanks in Advance.
Regards,
Sathish kumar D
Define "alive" here! Normal operation of a DLL is that it provides functions that gets called by the calling application. The DLL is then alive every time one of its functions is called and for the rest it sits dormant and wait.
You mention two threads so seem to spawn two threads from inside the DLL byt one or more function calls. The DLL will stay alive for as long as you let it be. This means as long as one VI is in memory that references one of the DLL functions in a static matter (the DLL path and name defined in the Call Library Node and not passed to it as parameter), LabVIEW will leave that DLL in memory. But once the last VI referencing that DLL is gone, your DLL is forcefully unloaded by LabVIEW no matter what your threads would like to have.
12-29-2009 03:08 AM
Hi All,
Thanks for your comments.
We found the problem; Its due to the "Call Back Functions" present in the dll. It has been fixed now by removing those functions.
Thanks Again.
Regards,
Sathish kumar D