Quantcast

Data Acquisition Toolbox

Controlling Your Acquisition

Data Acquisition Toolbox supports a wide range of functions for controlling your acquisition. For example, you can set event information, evaluate acquisition status, define triggers and callbacks, preview data while a device is running, and perform analysis on the fly. The toolbox also supports several hardware-specific properties that can be displayed and customized to your specifications.

Managing Data

The toolbox provides functions for previewing and extracting data for analysis. It streams data into MATLAB or Simulink in double-precision floating-point format, enabling you to work with the data just as you would with any other matrix in MATLAB or Simulink. You can also use a native hardware format to stream in data.

Logging Data

Data Acquisition Toolbox provides functions for logging data to disk, memory, or both, while an analog input object is running. You can log data, events, and errors. In addition, the toolbox provides functions for extracting data from log files it has generated.

Using the Oscilloscope Interface

You can interactively select and configure data acquisition sources in MATLAB. A familiar oscillosope-like interface enables you to acquire, view, and analyze data. Through a library of built-in measurement functions, you can verify hardware operation and perform live data analysis. You can extend the interface with your own analysis functions and export data to the MATLAB workspace. This oscilloscope UI is available on the 32-bit version of MATLAB only.

Two channels of live audio data displayed and analyzed using the SoftScope graphical interface.

Two channels of live audio data displayed and analyzed. A few lines of code let you acquire two seconds of data from a data acquisition board, calculate the frequency components of the data, and plot the results in MATLAB.

Basic Features of the Oscilloscope Interface 2:19
Acquire and display data from data acquisition cards without writing code using the oscilloscope interface.

Advanced Features of the Oscilloscope Interface 4:09
Make custom measurements on acquired data and export results to the MATLAB® workspace using advanced features of the oscilloscope interface.

Simultaneous Collection and Analysis of Data

Most data acquisition tasks are initiated by events. An event occurs at a specific time after a condition has been met. Event types supported by Data Acquisition Toolbox include:

  • Start and stop
  • Number of samples acquired
  • Errors
  • Triggers
  • Number of output samples

Events may result in one or more callbacks. In MATLAB, these event types execute a MATLAB function that you specify.

The session-based interface provides functions for both foreground and background data acquisition. Foreground data acquisition blocks the MATLAB command line; background acquisition does not. Background acquisition enables you to collect data continuously and plot or process the data while you are collecting it. A listener is available to flag session events. When an event occurs, the specified callback function is executed.

Handling Errors

Data Acquisition Toolbox provides a consistent set of error and warning messages. If a hardware error message is not handled by the toolbox in MATLAB or Simulink, an external error is reported with the vendor-specific hardware error message.

Evaluating Your Acquisition

Data Acquisition Toolbox lets you evaluate the status of an acquisition and the available data acquisition resources, including installed hardware, hardware drivers, and adapters. You can display the following types of information:

  • Device object and channel status
  • Session object status
  • Hardware information
  • Data acquisition engine information
Script illustrating the four steps of a typical MATLAB data acquisition session: creation, configuration, acquisition, and clean-up.

Script illustrating the four steps of a typical MATLAB data acquisition session: creation, configuration, acquisition, and clean-up. A few lines of code let you acquire two seconds of data from a data acquisition device, process the acquired data, and visualize the results.

Next: Acquiring Data in Simulink

Try Data Acquisition Toolbox

Get trial software

Hands-on Learning with MATLAB and Analog Discovery

View webinar