Data Acquisition Toolbox
Data Acquisition Toolbox supports PC-compatible data acquisition hardware from multiple vendors, including National Instruments, Digilent, and Analog Devices. The toolbox also supports Microsoft® Windows® compatible sound cards. See more information on supported hardware.
If you work with a variety of hardware, the toolbox provides common base properties that apply to all supported hardware, such as sample rate, trigger settings, and channel properties. Using these properties promotes code reuse and reduces the need to change code when you change hardware. The toolbox also enables you to access device-specific features of your hardware from MATLAB.
Data Acquisition Toolbox lets you make a variety of measurements directly from MATLAB without the need to convert the data. Most data acquisition hardware provides the general capability to convert analog voltage data to a digital signal that a computer can process. Some data acquisition hardware has additional capabilities that allow for collecting and processing data directly from thermocouples, RTD devices, IEPE accelerometers and microphones, current-based sensors, or bridge-based sensors. To facilitate making measurements directly from MATLAB, Data Acquisition Toolbox supports the following measurement types:
Voltage — Data from general purpose A/D cards and sound card recording devices
Current — Data from current-based sensors, such as 4-20 mA sensors commonly used for process control
IEPE accelerometer — Data from IEPE accelerometers that need a constant excitation current source on the same wire on which you measure the acceleration
IEPE microphone — Data from IEPE microphones that need a constant excitation current source on the same wire on which you measure the sound pressure
Thermocouple and RTD — Data measured in degrees Celsius, Fahrenheit, or Kelvin
Bridge-based sensor — Data from resistive sensors, such as strain gauges in a variety of bridge configurations that require an excitation voltage
The toolbox provides functions to access four subsystems commonly found on DAQ hardware: analog input, analog output, digital I/O, and counter/timer.
You can use Data Acquisition Toolbox to access the subsystems of your DAQ hardware from National Instruments and other vendors and perform a wide variety of measurements such as voltage, current, temperature, IEPE accelerometer, and bridge measurements.
You can create session objects to provide a gateway to the hardware's functionality and to control the behavior of your acquisition. By adding channels or lines to your session object, you can synchronize your data collection. The toolbox supports an unlimited number of channels or lines, enabling you to use as many as your hardware permits.
Analog input functions let you acquire signals from your hardware. You can create a session object, add analog input channels to the object, acquire data to memory, read data into the workspace, and preview the most recently acquired data.
Analog output functions let you send signals out from your hardware. You can create a session object, add analog output channels to the object, queue data sets for output, and generate analog signals.
Digital I/O functions enable you to generate or read digital signals using your hardware. You can create a session object, add digital I/O lines to the object, send data to the hardware, and read data into the workspace. The toolbox supports clocked digital I/O.
Counter/timer functions let you access counters on data acquisition hardware. You can configure counters as input or output channels. Counters configured as inputs can count events and measure frequency, pulse width, and position. Counters configured as outputs can generate pulse trains.
Audio input and audio output functions let you acquire and generate signals using built-in or external sound cards. You can create a session object, add multiple audio input or output channels to the object, acquire data to memory, read data into the workspace, and preview the most recently acquired audio data.
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.
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.
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.
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:
Events may result in one or more callbacks. In MATLAB, these event types execute a MATLAB function that you specify.
Data Acquisition Toolbox 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.
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.
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: