Skip to content

Commit 706bf2b

Browse files
committedJul 7, 2015
pxi6733: allow usage of 2-dimensional arrays. close #66
1 parent 8a33d8c commit 706bf2b

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed
 

Diff for: ‎artiq/devices/pxi6733/driver.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ def load_sample_values(self, sampling_freq, values):
6363
The device will output samples at each clock rising edge.
6464
The device waits for a clock rising edge to output the first sample.
6565
66-
When using several channels simultaneously, you must concatenate the
67-
values for the different channels in the ``values`` array.
68-
The sample values for the same channel must be grouped together.
66+
When using several channels simultaneously, you can either concatenate
67+
the values for the different channels in a 1-dimensional ``values``
68+
numpy ndarray.
6969
7070
Example:
7171
@@ -76,16 +76,21 @@ def load_sample_values(self, sampling_freq, values):
7676
channel and the two following samples will be output via the second
7777
channel.
7878
79+
Or you can use a 2-dimensional numpy ndarray like this:
80+
81+
>>> values = np.array([[ch0_samp0, ch0_samp1],[ch1_samp0, ch1_samp1]],
82+
dtype=float)
83+
7984
Any call to this method will cancel any previous task even if it has
8085
not yet completed.
8186
8287
:param sampling_freq: The sampling frequency in samples per second.
83-
:param values: A numpy array of sample values (in volts) to load in
88+
:param values: A numpy ndarray of sample values (in volts) to load in
8489
the device.
8590
"""
8691

8792
self.clear_pending_task()
88-
93+
values = values.flatten()
8994
t = self.daq.Task()
9095
t.CreateAOVoltageChan(self.channels, b"",
9196
min(values), max(values),

0 commit comments

Comments
 (0)
Please sign in to comment.