From: Rolf K. <r.k...@hc...> - 2011-08-25 19:24:49
|
Hi Enrico Thanks for your interesting report and a possible solution to a problem quite a lot of people seem to have run across in the past. >2) I find that the error messages reported by the labpython script note and by PYTHON Execute script.vi miss what would >be very useful information for debugging - the call stack or at least the offending python line number. Luaview reports such >information (in fact, contrary to LV convention of reporting only the source vi in the error cluster), and there is very useful. >Luaview and labpython share the same author IIUC... Just a small correction: LabPython was developed by me long ago, mainly as an exercise to test the script node interface that had appeared around LabVIEW 5. In order to test and debug the package interactively I had also developed a VI interface to it and that appeared to be quite handy as it allowed dynamic execution of Python scripts while the script node was static at runtime. LuaVIEW on the other hand was originally developed by my collegue Albert-Jan Brouwer for a large project he was working on. As such it was definitely more production quality class and there was a lot more time and energy invested into it. Over time I started to help with small maintenance tasks and modifications to it and I'm currently the maintainer of LuaVIEW. We are currently discussing internally about a LuaVIEW update and possible changes in how it will be distributed/licensed, possibly as part of the LabVIEW Tools Network. As much as I would like to work on some improvements to LabPython, I do lack both the time and commercial justification to do so. Some things like improved error messages would probably be not so hard to add, the issue about non global identifiers I would have no glue at this time why that would work different in the IDE than in LabPython. >3) I found one case, whith a 160 line python script which imports modules, in which the first call to PYTHON Execute script.vi takes >significantly more time than subsequent calls, *despite the fact that the script is precompiled*. The test is done by the BD attached, and >the overhead for the first call is some 600ms. Is there an explanation for the fact? There are quite a few possible reasons for something like that, such as additional binary or other modules that are used by your script that might have a lengthy initialization procedure. Remember that every LabPython session is much like an IDE command line. In your IDE you have probably also a lengthy initialization time for that script the first time you run it, but it may be harder to notice. Once you have run it the various modules are loaded and remain loaded until you close the IDE shell. Same for a LabPython session, but if you open a new session you effectively create a completely new and independent Python environment, that shares no variables, modules or whatsoever with other sessions. Rolf Kalbermatter CIT Engineering Nederlands BV |