Data Acquisition Toolbox    

Acquiring and Outputting Data

After you configure the device object, you can acquire or output data. Acquiring and outputting data involves these three steps:

  1. Starting the device object
  2. Logging data or sending data
  3. Stopping the device object

As data is being transferred between MATLAB and your hardware, you can think of the device object as being in a particular state. Two types of states are defined for the Data Acquisition Toolbox:

Running, Logging, and Sending are read-only properties that are automatically set to On or Off by the engine. When Running is Off, Logging and Sending must be Off. When Running is On, Logging and Sending are set to On only when a trigger occurs.

Starting the Device Object

You start a device object with the start function. For example, to start the analog input object 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

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.


 daqpropedit: A Graphical Property Editor Logging or Sending Data