Data Acquisition Toolbox    

Logging Data

While the analog input object is running, you can log acquired data to the engine (memory) or to a disk file. However, before you can log data a trigger must occur. You configure an analog input trigger with the TriggerType property. For a detailed description of triggers, refer to Configuring Analog Input Triggers.

When the trigger occurs, the Logging property is automatically set to On and data acquired from the hardware is logged to the engine or a disk file. You extract logged data from the engine with the getdata function. For example, to extract all logged samples for each channel contained by ai:

getdata blocks the MATLAB command line until all the requested data is returned to the workspace. You can extract data any time after the trigger occurs. You can also return sample-time pairs with getdata. For example, to extract 500 sample-time pairs for each channel contained by ai:

time is an m-by-1 array containing relative time values for all m samples. Time is measured relative to the time the first sample is logged, and is measured continuously until the acquisition stops. getdata is described in more detail in Function Reference.

You can log data to disk with the LoggingMode property. You can replay data saved to disk with the daqread function. Refer to Logging Information to Disk for more information about LoggingMode and daqread.


  Acquiring Data Stopping the Analog Input Object