From: Enrico S. <enr...@we...> - 2011-08-25 13:56:30
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html style="direction: ltr;"> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <style>body p { margin-bottom: 0cm; margin-top: 0pt; } </style> </head> <body style="direction: ltr;" bidimailui-detected-decoding-type="latin-charset" bgcolor="#ffffff" text="#000000"> Hi Ian,<br> <br> <blockquote cite="mid:C0F...@ES..." type="cite"> <p><font size="2"><font size="3"><font face="Arial" size="2">I have tended to avoid the "Python Script Node" as I found this less reliable.<br> </font></font></font></p> </blockquote> <p>I haven't yet accumulated enough experience to compare reliability. I'd just prefer the python session over the script node for all but the simplest tests, because you can create the python content programmatically - or load the python code at runtime from a file you edit more conveniently in a dedicated editor.<br> </p> <blockquote cite="mid:C0F...@ES..." type="cite"> <p><font size="2"><font size="3"><font face="Arial" size="2"><br> Issue (2) makes it very diffuclt to debug any code, in particular code that works ok in python IDLE but not in Labview (+ labpython).</font></font></font></p> </blockquote> <p>Definitely.<br> </p> <blockquote cite="mid:C0F...@ES..." type="cite"> <p><font size="2"><font size="3"><font face="Arial" size="2">I also find the lack of feedback when running a labpython script also limiting (i.e. Print statement doesn't output to anywhere). It would be great if the print command and error information could be displayed in a dos window or better in a dedicated window in labview, and even better if this was updated in real time.</font></font></font></p> </blockquote> <p>For what matters, luaview has an emulated stdout in a LV window, as support for the print statement. But luaview has certainly a much more complex handling of the interaction with LV, and can run asynchronously. A developer could perhaps say how difficult could be to implement such a feature .<br> </p> <blockquote cite="mid:C0F...@ES..." type="cite"> <p><font size="2"><font size="3"><font face="Arial" size="2"><br> To overcome the issues above, I now use the following as part of my python code.<br> </font><br> </font><font size="3"><font color="#0000ff">...<br> </font><br> </font><font face="Arial" size="2">This effectively redirects the stdout (print command) and stderr (error information) to a text file or debug log.</font></font></p> </blockquote> <p>viable idea<br> </p> <blockquote cite="mid:C0F...@ES..." type="cite"> <p><font size="2"><font face="Arial" size="2">I have also noticed the following additional issue:<br> 1) If I run the code below in labpython, then it works on the first iteration.</font></font></p> </blockquote> Can't comment on this.<br> <br> I can add a further wish: support for more input/output types. For instance I find myself dealing with images, which are large matrices of U8, and I would be forced to cast them to I32 in LV and downcast back to U8 in python; that is a detour and requires extra memory and time. (currently I convert them to strings, bytearray and reshape them in python, which wastes less memory but is still a detour).<br> <br> Enrico<br> </body> </html> |