Skip to content

Commit c91cd0a

Browse files
committedMay 21, 2015
pxi6733: use a writeable and c_contiguous numpy ndarray
1 parent 1e393f5 commit c91cd0a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎artiq/devices/pxi6733/driver.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Yann Sionneau <ys@m-labs.hk>, 2015
22

33
from ctypes import byref
4+
import numpy as np
45

56

67
class DAQmxSim:
@@ -48,6 +49,8 @@ def load_sample_values(self, values):
4849
t.CfgSampClkTiming(self.clock, 1000.0, self.daq.DAQmx_Val_Rising,
4950
self.daq.DAQmx_Val_FiniteSamps, len(values))
5051
num_samps_written = self.daq.int32()
52+
values = np.require(values, dtype=float,
53+
requirements=["C_CONTIGUOUS", "WRITEABLE"])
5154
ret = t.WriteAnalogF64(len(values), False, 0,
5255
self.daq.DAQmx_Val_GroupByChannel, values,
5356
byref(num_samps_written), None)

0 commit comments

Comments
 (0)
Please sign in to comment.