Skip to content

Commit 140239f

Browse files
committedJun 2, 2015
pxi6733: allow to set the sampling frequency
1 parent 59b3394 commit 140239f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎artiq/devices/pxi6733/driver.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def ping(self):
3939
return False
4040
return True
4141

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

5556
t = self.daq.Task()
5657
t.CreateAOVoltageChan(self.device+b"/"+self.analog_output, b"",
5758
min(values), max(values),
5859
self.daq.DAQmx_Val_Volts, None)
59-
t.CfgSampClkTiming(self.clock, 1000.0, self.daq.DAQmx_Val_Rising,
60+
t.CfgSampClkTiming(self.clock, sampling_freq,
61+
self.daq.DAQmx_Val_Rising,
6062
self.daq.DAQmx_Val_FiniteSamps, len(values))
6163
num_samps_written = self.daq.int32()
6264
values = np.require(values, dtype=float,

0 commit comments

Comments
 (0)
Please sign in to comment.