There is a way to configure LabVIEW to use a reference by name of your custom DLLs. You can configure the Call Library Function Node to use relative paths by adding the
Application Directory VI to your block diagram. Here is how it works:
- Add the Call Library Function Node to the block diagram and double-click it to open the configuration dialog.
- Check the Specify path on diagram option.
3. From the File I/O palette, navigate to the
File Constants and then add the
Application Directory VI to the block diagram.
4. Add the Build Path VI and then right-click the lower terminal and select
Create > Constant. In the string constant enter the name of the DLL file. Your VI should look like this example for the CLF Example.dll
This will ensure you code uses relative paths to call DLLs inside your project. In this example, the CLF_Example.dll is in the same directory of this VI. You can construct different paths using Build Path or Strip Path VIs.
Additional Information
LabVIEW always constructs the path to a DLL file internally to find the DLL file every time it needs to call a function that belongs to it. When you configure the Call Library Function node LabVIEW will prompt you to enter the path of the DLL you wish to call. It seems that the paths are both absolute and hardcoded in the VI whenever you use a DLL file located in your PC, as LabVIEW will try to look for this DLL if you move the project to another computer.