From: I P. <I.P...@ma...> - 2005-12-16 15:26:29
|
Hi Joakim, Thanks for the intro. to Labpython. I have tracked down the bug to Python 2.3.5. i.e. if you install any version upto and including Python 2.3.4, then the bug isn't present. The big thing that sticks out in the python release between v.2.3.4 and v2.3.5 is a security patch (http://www.python.org/security/PSF-2005-001/). "Note that these patches disable recursive traversal." I am not an expert in python or programming, but think that this may be worth investigating. Are any of the original developers still subscribed to this user group? Would you see this as a possible issue? A second bug I have found, is that if the python input("Please enter your name") command is used, and executed using the Labpython Execute script.vi then Labview crashes. If anybody can highlight any other bugs, or help solve the bug above that would be great. Cheers everybody Ian "Joakim Pettersson (LD/EAB)" <joa...@er...> Sent by: lab...@li... 07/12/2005 13:12 Please respond to labpython-users To: <lab...@li...> cc: Subject: RE: [LabPython-Users] Hello Hi Ian, Yes I use the script node and it works with Python 2.4 with some issues: 1. Only one script node per VI. 2. LabVIEW hangs when the VI is closed. So I have to kill LabVIEW using CTRL+ALT+Delete. The recipe is like this: 1. Download the package. 2. Copy pytscript.dll from labpython\File Group 0 to "C:\Program Files\National Instruments\LabVIEW 7.1\resource\script". 5. Copy the labpython\File Group 2\labpython folder into "C:\Program Files\National Instruments\LabVIEW 7.1\user.lib" or vi.lib depending on where you want the menu to appear in LabVIEW. 3. Open "PYTHON Set Server Path.vi" (in labpython\File Group 2\labpython) and execute it with path "C:\WINNT\system32\python24.dll". 4. Test the three VIs in labpython\File Group 3 and then File->Save with Options.../Save these. The labpython folder in your user.lib/vi.lib is now compiled to use python24.dll so you won't need to run "PYTHON Set Server Path.vi" again. I currently use a Python script VI as a toplevel GUI to a Python object that controls the rest of my mostly LabVIEW-based test system. So when I run the script, a number of subVIs open up and stay in run mode until I delete my test object in the script. Because of the bug 2 above, I plan to move the toplevel script into a pyton file that uses the GUI as a subVI instead. I can send the neat LabVIEW.py file I use to remote LabVIEW if you like (it runs on top of the win32com module). I took a look at the C code for the pytscript.dll and I think the bug is that the dll doesn't disconnect the session with the Python interpreter properly. It should probably call sys.exit () as cleanup when the VI is closed, but it was not obvious to me where I should do that. I got stuck because I didn't find the API description for LabVIEWs script node and I can live with the bug for a while. Please notify if you can't get it to work using the recipe above or if you dig further into the C code or get rid of the bug somehow. Best wishes, Joakim From: lab...@li... [mailto:lab...@li...] On Behalf Of I Phillips Sent: den 7 december 2005 12:12 To: lab...@li... Subject: [LabPython-Users] Hello Hi everybody, Anybody currently using LabPython ? I have been using Labview for years, and have just started writing scripts in Python, so I thought now was a good time to integrate the two. Any examples/tips/known issues would be welcome. Thanks in advance Ian |