Data Acquisition Toolbox | ![]() ![]() |
Acquiring Data
After you configure the analog input object, you can acquire data. Acquiring data involves these three steps:
Starting the Analog Input Object
You start an analog input object with the start
function. For example, to start the analog input object ai
ai = analoginput('winsound')
addchannel(ai,1:2)start(ai)
After start
is issued, the Running
property is automatically set to On
, and both the device object and hardware device execute according to the configured and default property values.
While you are acquiring data with an analog input object, you can preview the data with the peekdata
function. peekdata
takes a "snapshot" of the most recent data but does not remove data from the engine. For example, to preview the most recent 500 samples acquired by each channel contained by ai
data = peekdata(ai,500);
Since previewing data is usually a low priority task, peekdata
does not guarantee that all requested data is returned. You can preview data at any time while the device object is running. However, you cannot use peekdata
in conjunction with hardware triggers since the device is idle until the hardware trigger is received.
![]() | The Samples to Acquire per Trigger | Logging Data | ![]() |