| Data Acquisition Toolbox™ | ![]() |
sample = getsample(obj)
obj | An analog input object. |
sample | A row vector containing one sample for each channel contained by obj. |
sample = getsample(obj) immediately returns a row vector containing one sample for each channel contained by obj.
Using getsample is a good way to test your analog input configuration. Additionally:
getsample does not store samples in, or extract samples from, the data acquisition engine.
You can execute getsample at any time after channels have been added to obj.
Except for sound cards, you can use getsample on an analog input object that is not running (Running is Off). For sound cards, the device object must be running.
Note Refer to the Vendor Limitations section before you access National Instruments® devices with the NI-DAQmx adaptor simultaneously from multiple applications. |
Create the analog input object ai and add eight channels to it.
ai = analoginput('nidaq','Dev1');
ch = addchannel(ai,0:7);The following command returns one sample for each channel.
sample = getsample(ai);
![]() | getdata | getvalue | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |