NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I change the working directory for Teststand

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

0 Kudos
Message 1 of 4
(4,308 Views)

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.

 

 

Message Edited by MatLaroche on 04-29-2009 10:23 AM
Message Edited by MatLaroche on 04-29-2009 10:24 AM
0 Kudos
Message 2 of 4
(4,289 Views)

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.  

0 Kudos
Message 3 of 4
(4,284 Views)

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
);

If the issue is finding subordinate DLLs, you could see if adding the XXX\bin directory to the Path environment variable would solve the overall issue.
Scott Richardson
0 Kudos
Message 4 of 4
(4,278 Views)