10-22-2014 11:55 AM
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
Solved! Go to Solution.
10-23-2014 06:41 AM
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
10-23-2014 06:55 AM - edited 10-23-2014 06:56 AM
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
10-23-2014 09:41 AM
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
10-23-2014 09:42 AM
...I still see the front panel of the launched VI after unloading all modules from TestStand...
10-24-2014 02:09 AM
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
11-27-2014 05:31 AM
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
12-01-2014 02:15 AM
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