forked from M-Labs/artiq
1
0
Fork 0

pxi6733: use a writeable and c_contiguous numpy ndarray

This commit is contained in:
Yann Sionneau 2015-05-21 18:02:38 +02:00
parent 1e393f5c70
commit c91cd0ab38
1 changed files with 3 additions and 0 deletions

View File

@ -1,6 +1,7 @@
# Yann Sionneau <ys@m-labs.hk>, 2015 # Yann Sionneau <ys@m-labs.hk>, 2015
from ctypes import byref from ctypes import byref
import numpy as np
class DAQmxSim: class DAQmxSim:
@ -48,6 +49,8 @@ class DAQmx:
t.CfgSampClkTiming(self.clock, 1000.0, self.daq.DAQmx_Val_Rising, t.CfgSampClkTiming(self.clock, 1000.0, self.daq.DAQmx_Val_Rising,
self.daq.DAQmx_Val_FiniteSamps, len(values)) self.daq.DAQmx_Val_FiniteSamps, len(values))
num_samps_written = self.daq.int32() num_samps_written = self.daq.int32()
values = np.require(values, dtype=float,
requirements=["C_CONTIGUOUS", "WRITEABLE"])
ret = t.WriteAnalogF64(len(values), False, 0, ret = t.WriteAnalogF64(len(values), False, 0,
self.daq.DAQmx_Val_GroupByChannel, values, self.daq.DAQmx_Val_GroupByChannel, values,
byref(num_samps_written), None) byref(num_samps_written), None)