NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to force unload of dll in TestStand

We have a dll file which is used to control a MPLAB Real Ice programmer in a test sequence. This dll uses a lot of memory, but we dont have the source-code, so we cannot modify it.

Our only option right now is to have TestStand release the dll - and the memory - after the test is done.

But it does not seem to work. Even after the test has been stoppet and "unload all modules" has been executed, the memory is not released until we shut down TestStand completly.

 

Does someone here have any tips regarding the use - and release - of dll's (the dll is written in C++) ?

0 Kudos
Message 1 of 9
(7,504 Views)

Are you using the Unload options for the Step?

 

What TestStand version are you using?

 

Regards
Ray Farmer
0 Kudos
Message 2 of 9
(7,492 Views)

I am using TestStand 4.2.0

 

I have tried to unload after step executes, but it makes no differens.

0 Kudos
Message 3 of 9
(7,489 Views)

The DLL could be forcing itself to remain loaded with unbalanced LoadLibrary calls. You might try dynamically loading and unloading it from a simple c/c++ program to verify whether it unloads correctly.

0 Kudos
Message 4 of 9
(7,478 Views)

The dll might be getting unloaded, but the memory might still not be getting freed. It depends on the implementation of the dll. There might be a function in the dll to free the memory that you should be calling.

 

Hope this helps,

-Doug

0 Kudos
Message 5 of 9
(7,464 Views)

 

If you are still suspecting that the Teststand is responsible for not releasing the DLL memory, put a Statement Step at the End of the Sequence and use this expression "RunState.Engine.UnloadAllModules" (just for testing). It will force all the modules to Unload eventhough what ever option may set in the Step Settings or Sequence File Settings.

 

If the DLL is still catching up the memory, then you have to check the DLL.

 

 

AshwiN,

0 Kudos
Message 6 of 9
(7,448 Views)

Hi guys and thanks for your replies!

 

We have found out that the DLL we use calls several other DLLs, one of which calls a COM object. We think the COM object causes the problem as most of the DLLs seem to unload as they should.

 

Our solution is to drop the current programmer and buy one that is better prepared for industrial use.

0 Kudos
Message 7 of 9
(7,445 Views)

Hi Winther,

 

I'm trying to do the same thing : program and read a PIC for industrial production. I planned to use MPLAB ICD3 debugger, but with what I see on the internet I may try to find another software suite.

Did you continue to use MPLAB for your test needs or did you find another software program better for industrial use ? Could you advise me another software ?

 

Thanks a lot !

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 8 of 9
(7,143 Views)

Hi zy17.

 

We have switched to the ICP2 programer from Softlog Systems, and it seems to do the job well.

 

I have not communicated with them myself, but from what I hear from one of my collages they have good support for their products.

0 Kudos
Message 9 of 9
(7,139 Views)