LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DLL path

Solved!
Go to solution

A vi need to call a dll. May I know where should I place the dll.

 

The vi is inside a vi library. Later may need to compile all the vis into exe.

 

Any suggestion, thanks.

0 Kudos
Message 1 of 4
(5,865 Views)

Is this a custom DLL that you wrote? Then it should probably be stored with your project files on disk. When you build the application it will be copied to the "data" folder that resides in the same folder as the application.

 

Message 2 of 4
(5,857 Views)
Solution
Accepted by topic author alex.

Custom DLLs don't have to be in the project directory but can reside in the same directory as your library VIs are. As long as you copy the entire library including the DLL in one go, this should work fine. The LabVIEW application builder will for all DLLs where you haven't only entered the DLL name alone (it does always show the current path in the library path but it is important how you entered it) include them into the support directory and adjusts any Call Library Node in the executable to point to that location.

 

For DLLs where you only entered the DLL name, LabVIEW assumes (correctly) that it is a system library such as any DLL that would be found in the Windows orSystem(32) directory or in any directory found in the PATH environment variable and does not include it in the built application, but lets Windows locate the right DLL also in the executable

 

Especially for Windows system DLLs it is very important to NEVER include them in your built application. Aside from license issues (you don't have the right to distribute Windows DLL components) a different system DLL than the one installed in a system is almost always going to cause serious trouble. Especially if an application uses its own version of a DLL like kernel32.dll it will badly fail since that version of the DLL has no idea about already created system objects in the properly loaded DLL elsewhere in Windows and simply will crash on many function calls.

Message Edited by rolfk on 03-21-2010 10:26 AM
Rolf Kalbermatter
My Blog
Message 3 of 4
(5,845 Views)

It is a customized dll. I create a directory for all my sub vis named 'subvi' under project folder.

 

So I can put the dll directly under the 'subvi' folder.

 

When I copy the whole project folder to another location, it should still running well.

 

Also, it is built, the dll should go into the 'data' folder. 

 

I am right, thanks.

0 Kudos
Message 4 of 4
(5,826 Views)