12-04-2010 11:05 AM
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
12-04-2010 11:48 AM - edited 12-04-2010 11:49 AM
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.
12-04-2010 01:11 PM
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.
12-04-2010 01:40 PM
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.
12-04-2010 03:55 PM
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
12-06-2010 09:20 AM
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
12-07-2010 11:04 AM
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.....
12-07-2010 12:06 PM
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
12-07-2010 12:11 PM
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
12-07-2010 06:53 PM
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.