I was requested to provide Labview bindings for an app written in mostly in python and I've found LabPython tobe a blessing. However, I run into a nasty problem and I can't really figure who is to blame.
In a nutshell: LabPython does not unload python server dll and dll of imported modules (python27.dll and *.pyd) after "PYTHON Close Session.vi" have been executed and VI stopped . For most cases it causes no problem, but numpy module causes LabView to hang when "import numpy" is executed on the second run.
I'll greatly appreciate any help with the matter, because I can't even tell who is to blame - labpython, numpy, or LabView
In details:
1. Here is a test case
2. When the VI is loaded into memory, only labpython.dll have been loaded - OK.
3. When the VI have been run the python27.dll and a lot of numpy-related dll's are loaded and remain in memory when the VI stops.
4. If I quit the VI, labpython.dll is unloaded, but all other dll's remains - this definitely seems to be wrong.
5. The second run generates an error and hangs on closing
Some handles are open at this moment:
6. If I do not quit the VI before second run (skip step 4), there is no error and it hangs on the first labpython VI after "import numpy" execution.
I tested this behavior with
1) Labview 2012, labpython 4.0.0.4, python 2.7, numpy 1.7.1 and 1.6.1
2) Labview 2012, labpython 4.0.0.4, python 2.4, numpy 1.4.1
3) Labview 8.5, labpython 1.2, python 2.7, numpy 1.6.1
Test VI is attached to the post.
test.vi