NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand don't unload handle in a DLL after step is executed and unloaded

Hi,
 
Sorry for the 'Google' English. I hope you can understand my problem.
 
 
I developed a DLL (in C, under Visual C++.NET 2003) to program board by Ethernet. Then I developed VIs (LV 7.1) for this DLL. It's work very well.
 
I adapted these VIs for TestStand 2.0.1 (Test Data indicator and Input buffer command - with the good connector). I had sometime error -18002 (Server close VI) then I configured steps so that TS load them dynamically and unload after the steps execution.
With this step configuration, I can unloaded an Access file opened in a VI.
 
In the DLL, I open another ASCII file then I close it before go back under LabVIEW. When I launch the VIs without using TestStand ('Edit code' and run under LV), I can launch the programming several times. But if I use 'Run selected step', I can launch only one programming: the file can't be open any more (handle already used). If I do 'run selected step' several times (4 to 5 times), I have an error -18002 and I must close LabVIEW and TestStand for all to free. I tested on another PC which works very well but there too I have the same problem.
 
How do I have to configure TestStand to be sure that it releases the resource? Thank you in advance for your help.
 
My NI login didn't work since many months (thanks Laura F. of ni.com to solve this problem) so I posted this message on NI France (SR 7158216). Today, they did not find a solution yet. The support tested the call of a DLL (opening/closing of a file) CVI directly under TestStand without problem. They must test the call of the DLL in one VI, called under TestStand. If somebody encountered already this problem and found a solution, that interests me because my customer want now to have his program speedly. Thanks a lot.
 
Regards.
 
 
PS:
If that can help somebody:  LabVIEW does not like 'BOOL' and 'u_char' types in a DLL: the DLL works without error but the result is bad. It is to better use 'int' (instead of 'BOOL') and 'unsigned char' (instead of 'u_char') even of they are used in an internal function with the DLL. I must search a long time before understand this problem.
0 Kudos
Message 1 of 3
(3,405 Views)

The problem is solved.

If a C function has a char* argument, we systematically should not call the DLL while passing a char* (an U8 array). If the argument is well a U8 array, we can enter a char* but if it is a string, we must use CStr.

If the string is a filepath, TestStand does not release the handle file when the VI is closed if a char* was passed.

0 Kudos
Message 2 of 3
(3,358 Views)
Thanks for your answer
0 Kudos
Message 3 of 3
(3,333 Views)