LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call Library Function (DLL) Node Configuration

This issue was discussed few times on this forum (see for example http://forums.ni.com/ni/board/message?board.id=170&message.id=182911 ),  but I still have a problem.
My question is -  how to define the call to DLL without to specify its full path in order to be able to change the directory path without to change all calls to DLL functions within VI.
 
So, I did:
1. I put my DLL and my VI in the same directory.
2. I defined this directory in VI search path. This directory also defined as enviroment variable.
3. I use only one call to DLL in this specific VI (just as example in order to simplify the problem).
4. I define only DLL name without the path in CLF Node.
 
 
But, every time when I close CLF Node configution window, the program search for the DLL, find it and put full DLL path inside.
 
I will be very thankful if anyone can help me to overcome this problem.
 
Best regards,
Boris
0 Kudos
Message 1 of 2
(4,749 Views)
Hello Boris,

To sum up the previous posts, when you specify the DLL when configuring the Call Library Function node, internally LabVIEW stores in the VI either 1) the name of the DLL, or 2) a relative path from the VI to the DLL (including the name of the DLL). What's displayed in the dialog (in 'Library Name or Path' field) is either 1) the name of the DLL, or 2) an absolute path that is formed by appending the DLL's relative path to the VI's absolute path.

In case 1, LabVIEW uses the Windows system search paths to load the DLL. That is, it looks for the DLL in \windows\system32 folder, then if not found there, it uses the folders specified in the PATH environment variable, etc.
In case 2, LabVIEW tries to load the DLL from the computed absolute path (VIs current path combined with the relative path to the DLL that LabVIEW stored internally). And if not found there, LabVIEW uses the VI Search Path (that can be set from Tools » Options in the category of Paths).

So even though LabVIEW automatically puts an absolute path to the DLL in the Call Library Function Node, as long as you will specify the correct folder for the DLL in the VI Search Path, you should be Ok. However, if you want to have a fixed location for the DLL, then it is best to keep it in the \windows\system32 folder, and specify just the name of the DLL when configuring the Load Library Function node (this way LabVIEW will not automatically turn it into an absolute path).

Also, these knowledge base articles might be helpful:

Why Does My VI Prompt for My DLL Every Time I Open It?

LabVIEW Searching for a DLL Used in the Call Library Function Node
My Stand-Alone Executable Cannot Find My DLL, Even Though I Have Specified the Path for the DLL


Hope this helps and good luck with your application!
Shakhina P.
NIC
Message 2 of 2
(4,729 Views)