Jump to content

Gerod

Members
  • Posts

    6
  • Joined

  • Last visited

Gerod's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi to all! Finaly I found a way to fix the problem. Really I dint solved the problem, I only avoid it. The trick is to run 2..n times the script without closing the Python session. Ciao
  2. QUOTE(Scott Carlson @ Aug 1 2008, 06:55 PM) I tried d.del() also from commandline but... >>> c=1 >>> d.drawString(100, 100, "a+b=: %d" % c) >>> d.showPage() >>> d.save() >>> d.del() File "<stdin>", line 1 d.del() ^ SyntaxError: invalid syntax >>> QUOTE(Scott Carlson @ Aug 1 2008, 06:55 PM) Also, try to comment out the instantiation line before you execute a second time (comment the d = canvas.Canvas line) and see if that works.. The object may already be there? If these suggestions don't work, I'll install LabPython tonight after work, and give it a shot locally. PYTHON Execute Script__ogtk.vi->scriptino.vi:<type 'exceptions.NameError'>, name 'd' is not defined
  3. This is the vi i run (once) to call the script. No loop, no run continuously, only click twice the arrow. I forgot. I tried also to add p=None at the end of the script but without success. The only way to run twice is to close LabVIEW completely and load again the vi, these suggests me that there is some resource reserved by LV.
  4. This is a second clear version to reproduce the problem without MySQL. This script can run n-times from commandline but only 1 calling it from LV [/b]from reportlab.pdfgen import canvasd = canvas.Canvas("scriptino.pdf")a=1b=1c=a+bd.drawString(100, 100, "a+b= %d" % c)d.showPage()d.save()[b][/b][b] This script can run n-times both from commandline and from LV [/b] from reportlab.pdfgen import canvas a=1 b=1 c=a+b [b] ?!? :headbang:
  5. I'm trouble with a simple python+mysql+reportalab script called by LV. The problem is that the 1st time i run the vi there is no proble, but the 2nd,3rd,.. time doesnt work with a error PYTHON Execute Script__ogtk.vi->python_report.vi:<type 'exceptions.TypeError'>, The LabVIEW vi does the following steps: 0) create a new python session 1) read the script from file 2) set the 3 string variables select_obj, table, where 3) runs the script 4) close the python session the python script is the following import MySQLdbfrom reportlab.pdfgen import canvasdb=MySQLdb.connect(host="localhost",user="root", passwd="password",db="test") cursor = db.cursor() cursor.execute("SELECT %s FROM %s WHERE %s" % (select_obj, table, where) ) c = canvas.Canvas("prova.pdf") y=700; while 1: row = cursor.fetchone() if row == None: break c.drawString(100, y, "Description: %s || Allarm? %s" % row) y = y - 100 c.drawString(100, y, "Number of rows returned: %d" % cursor.rowcount) cursor.close() db.close() c.showPage() c.save() someone else encountered a similar behaviour?
  6. I'm trying to to acquire datas with a NI PCI-6601 and COMEDI driver with a computer running SuSE 10.0. Digital I/O capability of the board are nicely supported, but even if the driver correctly recognize the board and its subdevices (DIO and counters/timers), I still haven't found and example that shows a way to generate/count pulses. Thank you.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.