You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LibraryInterpreter.read_raw sets cfunc.argtypes based on the dtype of the array you pass in:
def read_raw(self, task, num_samps_per_chan, timeout, read_array):
samples_read = ctypes.c_int()
number_of_bytes_per_sample = ctypes.c_int()
cfunc = lib_importer.windll.DAQmxReadRaw
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
lib_importer.task_handle, ctypes.c_int, ctypes.c_double,
wrapped_ndpointer(dtype=read_array.dtype, flags=('C', 'W')),
ctypes.c_uint, ctypes.POINTER(ctypes.c_int),
ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)]
...
However, this is incorrect because cfunc.argtypes is only initialized once.
I haven't tested this yet, but I expect it to remember the dtype of the 1st array that you pass to task.in_stream.read_into() and reject any array with a different dtype.
I think the correct way to make ndpointer accept any array dtype is to specify dtype=None.
The text was updated successfully, but these errors were encountered:
LibraryInterpreter.read_raw
setscfunc.argtypes
based on thedtype
of the array you pass in:However, this is incorrect because
cfunc.argtypes
is only initialized once.I haven't tested this yet, but I expect it to remember the
dtype
of the 1st array that you pass totask.in_stream.read_into()
and reject any array with a differentdtype
.I think the correct way to make
ndpointer
accept any arraydtype
is to specifydtype=None
.The text was updated successfully, but these errors were encountered: