Tribosonics Posted March 7, 2008 Report Share Posted March 7, 2008 Hi all, Title says it all. I'm a newbie to Python (and thus to Labpython) although not to LabVIEW. I've got a friend who is a Python genius but a newbie to LabVIEW. He's written me an algorithm in Python that i want to run in Labpython before trying to check it out before implementing it in LabVIEW (or i may just leave it in Python). Problem is we keep on getting errors and between us have no idea what is wrong. I cannot find any documentation on Labpython or examples (except for one here). What i need is a bit of Python code (some advanced stuff would be great) that runs succesfully in Labpython so that my friend can take a look and see the format/style/method of writing python code for Labpython). Could someone point me in the right direction either with a bit of code or some sort of documentation to help? Thanks Phil Quote Link to comment
Jim Kring Posted March 7, 2008 Report Share Posted March 7, 2008 Hi Phil, Here's a simple example (in LabVIEW 8.5): Download File:post-17-1204827742.vi Which versions of LabPython, LabVIEW, and Python are you using? Thanks, -Jim PS - The link here doesn't have anything to do with LabPython -- that example uses TCP-IP to communicate with Python, whereas LabPython uses a DLL to communicate with Python. Quote Link to comment
Nikodem Czechowski Posted February 16, 2016 Report Share Posted February 16, 2016 Hi guys. First of all - sorry for the thread necromancy, but I prefer that to making a new similar one. So... I've installed a fresh Installation of LabView 2015, OpenG Toolkit 4.0.x and LabPython 4.0.0.4. Apart from that I have Python 3.5 installed (Anaconda3). How to get these things to work together? I've tried to make a simplest possible VI with only three LabPython pieces - first of all I show him where the python35.dll is, the I open a new session and close it after that. What I get in return? some errors. First of all i get LabView error 1046 in "PYTHON New Session__ogtk.vi->Untitled 1" and then a Debugging Windows informs me that it "Couldn't load symbol _Py_ZeroStruct". So what is my mistake? can you help me? Quote Link to comment
Tim_S Posted February 16, 2016 Report Share Posted February 16, 2016 I haven't worked with LabPython. From the release information here it indicates that LabPython was tested with Python v2.5. Don't know if that makes a difference. Quote Link to comment
JKSH Posted February 17, 2016 Report Share Posted February 17, 2016 (edited) I haven't worked with LabPython. From the release information here it indicates that LabPython was tested with Python v2.5. Don't know if that makes a difference. I haven't used LabPython before either, but I do know that Python 2.x is not compatible with Python 3.x. Debugging Windows informs me that it "Couldn't load symbol _Py_ZeroStruct". I'm guessing that the function called "_Py_ZeroStruct()" exists in the Python 2.x DLL, but not the Python 3.x DLL. Try installing Python 2 instead. Edited February 17, 2016 by JKSH Quote Link to comment
Nikodem Czechowski Posted February 17, 2016 Report Share Posted February 17, 2016 Thank you Tim_S and JKSH - this is exactly what I've did and it seems to work with Python 2.7, although I have some other problems now (e.g. with running numpy). Quote Link to comment
gb119 Posted February 21, 2016 Report Share Posted February 21, 2016 (edited) Python 2.7 works with LabPython on LabVIEW up to (at least) 2014, 32bit only, BUT there is something about the anaconda builds that causes LabVIEW to crash on recent 2.7 releases. Running plain vanilla python as downloaded from python.org works fine. One gets the feeling that LabPython in its current form is not goign to be viable for very much longer as both languages continue to develop (Python 3.x and 64 bit code are not supported for example, the scripting node interfaces are not well supported with public documentation) - probably a better solution would be to build an interface between LabVIEW and a Juypter (ipython) kerenel process - but I know I don't have time to work on anything this complicated :-( Any python module that is not thread safe will also cause problems - unfortunately that includes numpy - but sometimes one can avoid tripping over the non thread-safe bits if one is cautious in which bits of numpy one tries to call). Edited February 21, 2016 by gb119 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.