Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Location of Working Directories When Using LabWindows/CVI To Debug an External Process

Primary Software: LabWindows/CVI Development Systems>>Full Development System
Primary Software Version: 8.5
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I have a TestStand sequence that calls a LabWindows/CVI DLL that I have created. I am attaching LabWindows/CVI to the TestStand Sequence Editor process by using the Run » Specify External Process command.

When debugging my DLL, some of the files that my DLL are looking for cannot be found. Our DLL references these dependent files using the \\<directory name>\\<filename> syntax. However, when I run my TestStand application in real-time without the LabWindows/CVI debugger, everything works. Why is this the case?

This may or may not be important, but both TestStand and LabWindows/CVI are installed onto the C:\ drive while my application and associated DLLs and files reside on the E:\ drive.

Solution:
The reason for seeing different behavior based on whether you are debugging or not has to do with the running application's working directory. When you run your application, the default working directory is the directory containing your application (i.e. in this case its the E: drive). Thus when you use "\\" to indicate the root directory, it goes to the root directory on the E: drive. Therefore your files are found.

When using LabWindows/CVI as the debugger, LabWindows/CVI uses its own directory as the working directory rather than the directory of the application. So in this case when you use the "\\" syntax to indicate the root directory, it goes to the root directory on the C: drive. Thus your files are not found.

To workaround this behavior, simply add E: to the pathname.

Related Links:

Attachments:





Report Date: 10/26/2007
Last Updated: 11/20/2007
Document ID: 4EP92A6S

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit