From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

unload all modules VI memory

Solved!
Go to solution

Hello,

 

I have TS2014, and some VIs compiled into LVLIBP (packed library) with LV2010 SP1.

 

Everything works, until I try to call "Unload all modules". The VIs launched from the LVLIBP are still running, even if I close the sequence file. Why??? They sould be uloaded!

 

Madottati

0 Kudos
Message 1 of 8
(6,422 Views)

Dear Madottati,

 

if I understand correctly you are using the engine method UnloadAllModules (http://zone.ni.com/reference/en-XX/help/370052M-01/tsapiref/reftopics/engine_unloadallmodules_m/). Correct me if I'm wrong.

 

It is stated that that this method should be called when no executions are running. Since you mention that the VI's are still running, I assume this behaviour might be intended. I'll do further investigation into that matter, though.

 

Could you provide a sequence file and the lvlibp (as minimal as possible) for a test? Do you use the 32 Bit or 64 Bit version of TestStand?

 

Kind regards
AndGar

Andreas Gareis
Senior Applications Engineer, NI
Certified LabVIEW Developer & TestStand Architect
0 Kudos
Message 2 of 8
(6,399 Views)

Hi,,

 

when I call UnloadAllModules, no execution is running - from TestStand side. A VI will be launched as a step in TS, then only the launched VI is running - even after unloading all modules.

 

It is also not working, if I launch just the VI outside the LVLIBP.

 

Attached you find a very simple example, please try it. I use TS2014 32 bit

 

regards

Madottati

0 Kudos
Message 3 of 8
(6,395 Views)

Dear Madottati,

 

I've tried your example but I'm not sure that I can reproduce it so far. I start TestStand and run your sequence and use the "Test UUT" entry point. You VI gets launched and is running in an infinite loop. The sequence passes and the VI keeps running since it's an infinite loop.

 

How do you proceed? Where do you see that the VI is still loaded in TestStand memory?

 

Kind regards

AndGar

Andreas Gareis
Senior Applications Engineer, NI
Certified LabVIEW Developer & TestStand Architect
0 Kudos
Message 4 of 8
(6,386 Views)

...I still see the front panel of the launched VI after unloading all modules from TestStand...

0 Kudos
Message 5 of 8
(6,384 Views)
Solution
Accepted by Madottati

Your understand of "Unload all Modules" is incorrect. Granted, the name is misleading.

In fact, "unload" means that it does free all references to the code.

 

If, however, the runtime environment of the module thinks that the code module has to be kept in memory, it will stay in memory.

 

In your case, you opened the front panel (dialog?) of the VI for infinite display. This front panel holds a valid reference to the VI. So if you free the handle of the VI from TS side, you still have a valid handle left: the one from the front panel. So the LV RTE (runtime engine) MUST NOT unload the VI unless you remove the last valid handle by closing the panel.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 6 of 8
(6,366 Views)

Hello Norbert,

 

thanks for your reply. I am still having some issues with unloading modules. Following.

 

I created a step type under the Type Palettes, let's say a global step type. The Post step of the step type is a VI, which belongs to a LVLIBP. The default unload option for the step type is "Unload when sequence file closes."

 

Well, after running the step, and closing the sequence file, the entire LVLIBP is still in the memory. I got this by calling the "GetAllVIsInMemory" property from LabVIEW. So I see the entire VI list of the LVLIBP, and the VI which requests the "GetAllVIsInMemory". For my understanding, all the modules have to be unloaded upon closing the sequence file, if the  "Unload when sequence file closes" is set. They will be onlyunloaded, if I explicitly call the Engine.UnloadAllModules method.

 

If I remove the .ini file from the Type Palettes, then it works: execute step -> close the sequence file -> GetAllVIsInMemory -> and the only VI remains in the memory is the VI with the "GetAllVIsInMemory".!

 

Can you please let me understand, why the unloading is not working, if the step type resides in the type palettes?

 

Madottati

0 Kudos
Message 7 of 8
(6,059 Views)

I am not 100% sure, but i think that the unload options do NOT refer to step type substep modules. At least, this would also explain your observation.

 

It should be sufficient to unload all sequence files and type palettes as all step type instances are removed from memory hence it is an implicit "unload".

 

But i haven't gone through tests to verify my expectations.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 8 of 8
(6,020 Views)