04-28-2009 05:17 PM
Hi everyone,
How do you change the working directory of teststand. When I run my software that loads Test Stand sequences, my software runs fine. The software resides in XXX\bin folder However, when I run these sequences using National Instrument's teststand, all my links are broken. The working directory clearly changed to C:\... National Instruments\TestStand3.5\bin. How can I change the default working directory within TestStand?
Btw. One work around was make a short cut with Start In: specified to XXX\bin. This works great for running from TestStand. However, I do try to debug teststand scripts by starting TestStand through CVI 8.1.1. When this happens I am back to square one.
Thanks for all the help in advance.
Kat
04-29-2009 10:22 AM - edited 04-29-2009 10:24 AM
Go in the TestStand editor menu
Configure --> Search Directories
Add the directory where you're modules are. It will look in that directory to find the modules you use.
Refer to the Search Paths section of Chapter 5, Module Adapters, of the NI TestStand Reference Manual (located in C:\Program Files\National Instruments\TestStand 4.1.1\Doc\Manuals)
This should answer all your questions. If you need more details after going through that, don't hesitate.
04-29-2009 10:32 AM
Search Directories just indicates where TestStand can load modules. We already specify the necessary locations. The problem is that some software use relative path locations. So when the software start directory is XXX/bin, the software runs fine. When the software start directory is TESTSTAND/bin, the software cannot properly function because it is accessing non-existing data files.
04-29-2009 10:39 AM
spazkat -
In general a DLL should not rely on the current (working) directory to find subordinate files, such as DLLs. Instead it should find out its path and build relative paths from there to find subordinate files. You could potentially set the current directory using the Windows SDK function in Kernel32.dll
BOOL WINAPI SetCurrentDirectory(
__in LPCTSTR lpPathName
);