From c91cd0ab38785a0da35fd48aed0e54b07775e9ce Mon Sep 17 00:00:00 2001 From: Yann Sionneau Date: Thu, 21 May 2015 18:02:38 +0200 Subject: [PATCH] pxi6733: use a writeable and c_contiguous numpy ndarray --- artiq/devices/pxi6733/driver.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/artiq/devices/pxi6733/driver.py b/artiq/devices/pxi6733/driver.py index b15e8df6b..a1569659a 100644 --- a/artiq/devices/pxi6733/driver.py +++ b/artiq/devices/pxi6733/driver.py @@ -1,6 +1,7 @@ # Yann Sionneau , 2015 from ctypes import byref +import numpy as np class DAQmxSim: @@ -48,6 +49,8 @@ class DAQmx: t.CfgSampClkTiming(self.clock, 1000.0, self.daq.DAQmx_Val_Rising, self.daq.DAQmx_Val_FiniteSamps, len(values)) num_samps_written = self.daq.int32() + values = np.require(values, dtype=float, + requirements=["C_CONTIGUOUS", "WRITEABLE"]) ret = t.WriteAnalogF64(len(values), False, 0, self.daq.DAQmx_Val_GroupByChannel, values, byref(num_samps_written), None)