Skip to content

Commit

Permalink
pxi6733: allow usage of 2-dimensional arrays. close #66
Browse files Browse the repository at this point in the history
fallen committed Jul 7, 2015
1 parent 8a33d8c commit 706bf2b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions artiq/devices/pxi6733/driver.py
Original file line number Diff line number Diff line change
@@ -63,9 +63,9 @@ def load_sample_values(self, sampling_freq, values):
The device will output samples at each clock rising edge.
The device waits for a clock rising edge to output the first sample.
When using several channels simultaneously, you must concatenate the
values for the different channels in the ``values`` array.
The sample values for the same channel must be grouped together.
When using several channels simultaneously, you can either concatenate
the values for the different channels in a 1-dimensional ``values``
numpy ndarray.
Example:
@@ -76,16 +76,21 @@ def load_sample_values(self, sampling_freq, values):
channel and the two following samples will be output via the second
channel.
Or you can use a 2-dimensional numpy ndarray like this:
>>> values = np.array([[ch0_samp0, ch0_samp1],[ch1_samp0, ch1_samp1]],
dtype=float)
Any call to this method will cancel any previous task even if it has
not yet completed.
:param sampling_freq: The sampling frequency in samples per second.
:param values: A numpy array of sample values (in volts) to load in
:param values: A numpy ndarray of sample values (in volts) to load in
the device.
"""

self.clear_pending_task()

values = values.flatten()
t = self.daq.Task()
t.CreateAOVoltageChan(self.channels, b"",
min(values), max(values),

0 comments on commit 706bf2b

Please sign in to comment.