TypeError: while constructing argument 4:

Todd Gardner piir at earthlink.net
Wed Dec 24 13:28:24 EST 2003


Hello all,

I need to ask for some of your expertise.  How to define the variable
so that I can pass it as an array of 16 bit integers?

...
ni = windll.nidaq32
buffer = c_int * 100
status = ni.DAQ_Op (deviceNumber, chan, gain, buffer, count,
sampleRate)
>>> 
Traceback (most recent call last):
  File "<string>", line 1, in ?
  File "C:\Documents and Settings\tnt\My
Documents\pc\ctypes\DAQ_Op1.py", line 21, in ?
    status = ni.DAQ_Op (deviceNumber, chan, gain, buffer, count,
sampleRate)
TypeError: while constructing argument 4:
Don't know how to convert parameter 4
>>> 

"""
BEGIN DEFINITION of the variable array {buffer}
buffer [i16] contains the acquired data 

buffer is an integer array. buffer has a length equal to or greater
than count. When DAQ_Op returns with an error number equal to zero,
buffer contains the acquired data.

The buffer must be aligned on a 4-byte boundary. If the buffer is
allocated as an array of i32s, it must be typecast to an i16 pointer
when passing its address to DAQ_Op. If the buffer is allocated as a
double-sized array of i16s, the user must check that the buffer is
aligned on a 4-byte boundary before passing the buffer to DAQ_Op.
END DEFINITION of the variable array {buffer}
"""

Thank you SO much for any information,

Todd
--
P.S. Sorry if this is a repost for you.  I am resending this post
because I believe that the people that follow the ctypes and tutor
lists are different that the people that follow this group.




More information about the Python-list mailing list