@@ -63,9 +63,9 @@ def load_sample_values(self, sampling_freq, values):
63
63
The device will output samples at each clock rising edge.
64
64
The device waits for a clock rising edge to output the first sample.
65
65
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 .
69
69
70
70
Example:
71
71
@@ -76,16 +76,21 @@ def load_sample_values(self, sampling_freq, values):
76
76
channel and the two following samples will be output via the second
77
77
channel.
78
78
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
+
79
84
Any call to this method will cancel any previous task even if it has
80
85
not yet completed.
81
86
82
87
: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
84
89
the device.
85
90
"""
86
91
87
92
self .clear_pending_task ()
88
-
93
+ values = values . flatten ()
89
94
t = self .daq .Task ()
90
95
t .CreateAOVoltageChan (self .channels , b"" ,
91
96
min (values ), max (values ),
0 commit comments