Skip to content

Commit

Permalink
pxi6733: allow to set the sampling frequency
Browse files Browse the repository at this point in the history
fallen committed Jun 2, 2015
1 parent 59b3394 commit 140239f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions artiq/devices/pxi6733/driver.py
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ def ping(self):
return False
return True

def load_sample_values(self, values):
def load_sample_values(self, sampling_freq, values):
"""Load sample values into PXI 6733 device.
This loads sample values into the PXI 6733 device and then
@@ -49,14 +49,16 @@ def load_sample_values(self, values):
A callback is registered to clear the task (deallocate resources)
when the task has completed.
:param sampling_freq: The sampling frequency in samples per second.
:param values: A numpy array of sample values to load in the device.
"""

t = self.daq.Task()
t.CreateAOVoltageChan(self.device+b"/"+self.analog_output, b"",
min(values), max(values),
self.daq.DAQmx_Val_Volts, None)
t.CfgSampClkTiming(self.clock, 1000.0, self.daq.DAQmx_Val_Rising,
t.CfgSampClkTiming(self.clock, sampling_freq,
self.daq.DAQmx_Val_Rising,
self.daq.DAQmx_Val_FiniteSamps, len(values))
num_samps_written = self.daq.int32()
values = np.require(values, dtype=float,

0 comments on commit 140239f

Please sign in to comment.