LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Keeping DLL alive from one VI to another

Dear All,

I have fairly rudimentary question.  In C++ when I load a DLL a pointer to this DLL stays "alive" untill the program exits.  In LabView however when the VI that calls user DLL completes exections, the DLL "disappears" and when I need to make another call to that DLL I need to creat a new pointer to it and so on.  Is there a way to keep the pointer to the user DLL from VI call to VI call?  That is to say that the first VI for example call a class constructor in the DLL and the subsequent VIs call methods within this DLL.  Let me know if I'm thinking too much like a C++ developer and not like a LabView.

 

             Best regards, Vitaliy

0 Kudos
Message 1 of 4
(2,433 Views)
Are you running VIs individually, or are you referring to calling VIs from a top-level VI that's kept running? A DLL is supposed to get unloaded when the VI that uses that DLL is unloaded (closed manually or via the VI Server). It also gets unloaded when LabVIEW quits (bviously). As for the actual operation, why is this important in your case? Are there static variables in the DLL?
0 Kudos
Message 2 of 4
(2,414 Views)
Just make sure at least one VI that calls the DLL stays in memory for as long as you want that DLL loaded.
Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 4
(2,399 Views)

Is this one top level VI that calls on several subVIs?

If so, if you call the DLL from the top level VI, it will stay open even if none of the subVIs are running.

Could you please explain how the VIs interact with each other?

Cory K
0 Kudos
Message 4 of 4
(2,380 Views)