LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView Working Directory

Hi all,

I have a problem concerning the LabView Default Directory specified under "Tools->Options". I have a DLL which is called by LabView. This DLL reads an INI-File which is referenced by a relative path in the DLL, i. e. "./inifile.ini" (as i know from the programmer of the code, i haven't written the code myself). But if I start LabView and execute this program, the Inifile isn't read as i can see from the values returned by the DLL. I found several workarounds, but the aren't perfect at all:
- If i place the ini-file into the default directory (c:\programs\national instruments\labview 8.5), the Ini file is read...but i don't want to put any files into that directory
- If i create a LabView-Project and add the Ini to the project, it works for the first time I added the files. But if i close LabView, reopen it, it doesn't work anymore (the files are still in the project!!). Deleting the files from the project and adding them again helps.

Anyone knows a way to tell LabView that the "Default directory" is the directory of the running vi??

Thanks in advance

Christian

THINK G!! 😉
------------------------------------------------------------------------------------------------
Using LabView 2010 and 2011 on Mac and Win
Programming in Microsoft Visual C++ (Win), XCode (Mac)
Message 1 of 3
(4,188 Views)
You can change the default directory using tools-> options to set it to a different path or use the ini key in the LabVIEW config file "labview.ini":
defaultdir = (Path to vi folder)
This change won't take effect till you restart LabVIEW.
You can use a custom LabVIEW ini file in the same directory as your project and use it to set the default path but you need to start LabVIEW with a command such as:
"c:\Program Files\National Instruments\LabVIEW 8.2\LabVIEW.exe" -pref "c:\MyProject\labview.ini"

See http://wiki.lavag.org/LabVIEW_ini_File for more information

An executable automatically loads its configuration file from the same folder as the exe.
_______________________________________
Systems Test Engineer
Certified LabVIEW Architect (CLA)
0 Kudos
Message 2 of 3
(4,163 Views)
Hi!

Thanks for your answer...a good solution... but sb. can tell me why the behaviour changes if i add the DLL to the project as described above?

Christian

THINK G!! 😉
------------------------------------------------------------------------------------------------
Using LabView 2010 and 2011 on Mac and Win
Programming in Microsoft Visual C++ (Win), XCode (Mac)
0 Kudos
Message 3 of 3
(4,123 Views)