Cast data to int in PyComediSingleIO.write_chan_index.
authorW. Trevor King <wking@drexel.edu>
Mon, 8 Dec 2008 17:24:09 +0000 (12:24 -0500)
committerW. Trevor King <wking@drexel.edu>
Mon, 8 Dec 2008 17:24:09 +0000 (12:24 -0500)
commit5b69b33d46529be30bbdf15b392f0b96986bdcdd
tree7aa37e2f12a1391454aa949e8e71dd2fd7d5cb04
parentb51a46ab787454e8fcc9cc0502bd45c0a36c5ac1
Cast data to int in PyComediSingleIO.write_chan_index.

Without the cast, I got this traceback when data was a numpy.uint16:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/wking/.python/unfold.py", line 101, in __init__
    self.zp.jumpToPos(self.zp.pos_nm2out(0))
  File "/home/wking/.python/z_piezo.py", line 161, in jumpToPos
    self.curIn = self._jump.jumpToPos(self.curOut)
  File "/home/wking/.python/z_piezo.py", line 248, in jumpToPos
    self.AO.write(out)
  File
"/home/wking/lib/python2.5/site-packages/pycomedi-0.1-py2.5.egg/pycomedi/single_aio.py",
line 90, in write
    self.write_chan_index(i, data[i])
  File
"/home/wking/lib/python2.5/site-packages/pycomedi-0.1-py2.5.egg/pycomedi/common.py",
line 411, in write_chan_index
    rc = c.comedi_data_write(self.dev, self.subdev,
self.chan[chan_index], self._range[chan_index], self._aref[chan_index],
data);
TypeError: in method 'comedi_data_write', argument 6 of type 'lsampl_t'
pycomedi/common.py