From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Path Environment variables

Hello,

I currently have a VI that relies heavily on DLL calls (call library
function). When specifying the location of the DLL, i give LabVIEW the
path to my INSTR.LIB directory, and everything works fine. My problem
occurs when I want to distribute the application to clients, and they do
not have LabVIEW installed in the same place as I do, that is, "C:\Program
Files\National Instruments\LabVIEW\Instr.Lib" is not their instr.lib
directory. Is there a built in envornment variable that i can use instead
of a hardcoded path in my DLL calls that points to the instr.lib
directory, or just the directory where labview.exe resides?? Thanks in
advance.

-Matt Siegel
0 Kudos
Message 1 of 7
(5,141 Views)
Matt Siegel wrote:

> Hello,
>
> I currently have a VI that relies heavily on DLL calls (call library
> function). When specifying the location of the DLL, i give LabVIEW the
> path to my INSTR.LIB directory, and everything works fine. My problem
> occurs when I want to distribute the application to clients, and they do
> not have LabVIEW installed in the same place as I do, that is, "C:\Program
> Files\National Instruments\LabVIEW\Instr.Lib" is not their instr.lib
> directory. Is there a built in envornment variable that i can use instead
> of a hardcoded path in my DLL calls that points to the instr.lib
> directory, or just the directory where labview.exe resides?? Thanks in
> advance.
>
> -Matt Siegel

I have not used the CLF much, but here are some thoughts.


Since this is a WinX platform, could you put the DLL in C:\Windows somewhere
and
hard code to that ?? This directory structure should be stable.

You could try putting the DLL in the same dir as the VI and hardcoding to
..\mydll.dll
Dont know if this will work though.

There are a few built in path functions (look in the File I/O palette) one VI
Library
will point to the directory where vi.llb is installed. This should be one
level deeper
than the labview.exe

After looking at this it seems unreasonable that you should have to hardcode
the path
to the DLL. I suppose that is what happens when you make assumptions about
how
your tool will be used.

Kevin Kent
0 Kudos
Message 2 of 7
(5,141 Views)
I believe that you can make relative calls instead of using absolute path in
the CLF dialog. That should solve your problem (put you dll in a subfolder
called data for example and put data next to your LLB). However, I've never
tried it. Check the documentation
The use of the function which will return the vi.lib folder location is
useful for VI calls. However, I don't think that you can use it for DLL
calls, since the CLF node doesn't have an input for the DLL path.

-Michel Farhi
0 Kudos
Message 5 of 7
(5,141 Views)
I'm not sure about the path to instr.lib but if you use the Open Application
Reference vi and then wire the Property Node vi to it, one of the available
properties is application directory path so you can find out where LabVIEW
is installed.

Matt Siegel wrote:
>Hello,>>I currently have a VI that relies heavily on DLL calls (call library>function).
When specifying the location of the DLL, i give LabVIEW the>path to my INSTR.LIB
directory, and everything works fine. My problem>occurs when I want to distribute
the application to clients, and they do>not have LabVIEW installed in the
same place as I do, that is, "C:\Program>Files\National Instruments\LabVIEW\Instr.Lib"
is not their instr.lib>directory. Is there a built in envornment variable
t
hat i can use instead>of a hardcoded path in my DLL calls that points to
the instr.lib>directory, or just the directory where labview.exe resides??
Thanks in>advance.>>-Matt Siegel>
0 Kudos
Message 3 of 7
(5,141 Views)
1. Copy DLL-file into your directory
2. In configure Call Library Function set only name of the DLL-file (Without
a path)

The best regards,
Yuri
Message 4 of 7
(5,141 Views)
The LabVIEW function in the file I/O>Constants fuction called Default Directory
will return the default directory of the LabVIEW. Try using this function
then build your path from there: Randall Thurman

Matt Siegel wrote:
>Hello,>>I currently have a VI that relies heavily on DLL calls (call library>function).
When specifying the location of the DLL, i give LabVIEW the>path to my INSTR.LIB
directory, and everything works fine. My problem>occurs when I want to distribute
the application to clients, and they do>not have LabVIEW installed in the
same place as I do, that is, "C:\Program>Files\National Instruments\LabVIEW\Instr.Lib"
is not their instr.lib>directory. Is there a built in envornment variable
that i can use instead>of a hardcoded p
ath in my DLL calls that points to
the instr.lib>directory, or just the directory where labview.exe resides??
Thanks in>advance.>>-Matt Siegel>
0 Kudos
Message 6 of 7
(5,141 Views)
Matt Siegel wrote:
>Hello,>>I currently have a VI that relies heavily on DLL calls (call library>function).
When specifying the location of the DLL, i give LabVIEW the>path to my INSTR.LIB
directory, and everything works fine. My problem>occurs when I want to distribute
the application to clients, and they do>not have LabVIEW installed in the
same place as I do, that is, "C:\Program>Files\National Instruments\LabVIEW\Instr.Lib"
is not their instr.lib>directory. Is there a built in envornment variable
that i can use instead>of a hardcoded path in my DLL calls that points to
the instr.lib>directory, or just the directory where labview.exe resides??
Thanks in>advance.>>-Matt Siegel>


On yout development computer you can use any path you want in the
DLL dialog.
When you distribute the application, make sure you put the DLL in the same
folder as your application and it will find it.
0 Kudos
Message 7 of 7
(5,141 Views)