NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

dll soes not work after restart teststand

Hi NI Team,

 

I have an issue whereby i am using a 3rd part dll to program a device. At 1st it is able to program correctly using the designated dll. But after i've restart the teststand, it still able to point to the dll, but seems like the dll is not working as it should be. In order to make it work again, I need to change the dll path to another location in order to make it work.

 

I've attached the following

 

Sequence.jpg

- Shows the module configuration

 

return_result.jpg

- Shows the return result of a weird return as the suppose return result suppose to be "1" or "0"

 

Please do advice. Thanks

Download All
0 Kudos
Message 1 of 12
(3,632 Views)

Are you properly closing/releasing resources to the DLL? I've successfully used a 3rd party DLL to command a UUT in a previous project. I would contact the 3rd party and ask what those codes mean when returned from the DLL.

0 Kudos
Message 2 of 12
(3,627 Views)

Thanks for the reply,

 

Can you share how do u unload / release the dll ( I am just a beginner in teststand) ? As i've noticed when i tried to delete the dll, seems like teststand still using it resource. I am able to delete only after closing teststand.

0 Kudos
Message 3 of 12
(3,619 Views)

Regarding TestStand still using the DLL, this is because TestStand loads it into memory because you've used it as a code module. This is remedied by selecting File > Unload All Modules or setting all of your DLL calls' Run Option to be one of the two "Unload after ..." settings.

 

As for releasing DLL resources, that's entirely dependent on the DLL you're using. You need to consult your documentation or the company that wrote the DLL and find out what those return values mean.

Message 4 of 12
(3,609 Views)

Is there a way to clear the search relative path ? i found out the only way the dll can work is using a path which has not been used as dll relative path before after restarting testand. What i am trying to do now is to clear the relative path everytime the sequence run, then set the path relative path again.

 

Thanks 

0 Kudos
Message 5 of 12
(3,604 Views)

Please explain exactly what you are doing and what you think the problem is. What are you changing the path to versus what it was before, and what do you mean by clearing the relative path? Is the path not resolving to the right file? What makes you think that is the case? Why would that be happening? Hopefully with more information we can help you come up with a better solution.

 

-Doug

0 Kudos
Message 6 of 12
(3,567 Views)

Hi There - Thanks for the reply,

 

The problem i am facing is the dll that i am using does not work as it should after restart teststand, unless i change the path or point the dll to another new path. The error that i am getting is, the return result shows that it can't open the file path that that has been defined in the dll call path name parameter. The weird thing is, the dll able to work (able to point to the right image again ) after i point the dll to another path, meaning if i create a new folder then dump in the same dll inside the folder and point the dll to new folder it able to work. But i will see the same problem again after i restart teststand. In terms of unloading the dll, i have tried the run options to unload module either after step end or sequence end. But the problem still exists.....

 

 

0 Kudos
Message 7 of 12
(3,541 Views)

Is is unlikely that this has anything to do with what teststand is doing. All teststand is doing is loading your dll and calling it with the parameters you specify. If your dll is returning a failure even though it is being called correctly by TestStand, then I recommend you try debugging the code inside the dll to more precisely determine why it is failing. If the call isn't making it into your dll at all then there is perhaps a different problem and we will need more details to determine what the cause is.

 

Hope this helps,

-Doug

0 Kudos
Message 8 of 12
(3,537 Views)

In reading what you wrote more carefully. I'm fairly sure that the problem you are seeing is related to what the dll you are calling is doing and is not related to what TestStand is doing. Perhaps the dll you are calling requires you do call an unload function of some sort when you are done, but since I'm not familar with the DLL you are using I can only guess.

 

-Doug

0 Kudos
Message 9 of 12
(3,534 Views)

Is there a way i can use teststand to force unload/kill the dll process ? Because after checking, the dll does not have this feature.

0 Kudos
Message 10 of 12
(3,517 Views)