NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the result when calling CVI dll which has a GetProjectDir() method in it?

Hi Guys
 
I encounterred a problem about calling CVI dll, the dll has a GetProjectDir() method, we can use the method to get work directory.
 
The dll and relevant files such as obj and lib are all in the same directory at D:\
 
But when the sequence is running , the GetProjectDir return the path"C:\Program Files\National Instruments\TestStand 3.1\Bin".
 
I guess the path is the ActiveX who call the dll, so the method return the path out of expectation.
 
Am I right?
 
And some guys could give a solution?
 
Thanks very much.
 
Rexxar
********************************
*The best Chinese farmer*
********************************
0 Kudos
Message 1 of 2
(3,322 Views)

While looking for an answer to the question you asked I saw your post and wanted to share my findings even if it's been quite a while since you posted it.

 

GetProjectDir does not return the correct dll location when you are using TestStand to call functions from the dll.

It does not matter whether you use the sequence editor or the default operator interface.

 

I tried GetDir function. If you run your sequence from the TestStand editor, it returns a value similar to GetProjectDir.

However, when you run from the operator interface, the dll location is correctly returned by GetDir.

 

This looked useful to me at first but then I realized this would require extra overhead and problems so I did not use it.

This matter is still a nuisance for me.

 

As a workaround, I started passing the value of RunState.SequenceFile.Path to my functions.

Since I generally keep the dll and the seq file together in the same folder, this method works for me.

 

S. Eren BALCI
IMESTEK
0 Kudos
Message 2 of 2
(3,038 Views)