Data Acquisition Toolbox

Accessing Subsystems of a DAQ Device

The toolbox provides functions to access four subsystems commonly found on DAQ hardware: analog input, analog output, digital I/O, and counter/timer. Depending on your application and hardware, you use either the legacy or session-based interface to communicate with the hardware.

Legacy and Session-Based Interfaces

 The legacy interface supports hardware from multiple vendors and all sound cards on 32-bit versions of MATLAB. (You can use this version of MATLAB on either 32-bit or 64-bit versions of Windows.) The legacy interface also supports voltage measurements of analog input, analog output, and digital I/O subsystems.

Setup for a data acquisition and analysis session using the legacy interface

Setup for a data acquisition and analysis session using the legacy interface. Data Acquisition Toolbox enables MATLAB or Simulink to interface with the data acquisition boards, such as sound cards.

The session-based interface supports analog input, analog output, digital I/O, and counter/timer subsystems on both 32-bit and 64-bit versions of MATLAB. This interface supports National Instruments hardware that can perform a wide variety of measurements such as voltage, current, temperature, IEPE accelerometer, and bridge measurements. The session-based interface also supports Windows sound cards and Digilent Analog Discovery hardware.

Sample code that uses the session-based interface.

Sample code that uses the session-based interface. Data Acquisition Toolbox enables MATLAB to discover and interface with data acquisition devices such as the NI 9205 CompactDAQ module.

In either interface, you create device or session objects to provide a gateway to the hardware's functionality and to control the behavior of your acquisition. For example, you can execute any supported analog input task via an analog input object created in MATLAB or Simulink.

By adding channels or lines to your device or session object, you can synchronize the collection of your data. The toolbox supports an unlimited number of channels or lines, enabling you to use as many as your hardware permits.

Analog Input

Analog input functions let you acquire signals from your hardware. You can create an analog input object, add channels to the object, acquire data to memory, read data into the workspace, and preview the most recently acquired data.

Analog Output

Analog output functions let you send signals out from your hardware. You can create an analog output object, add channels, queue data sets for output, and generate analog signals.

Digital I/O

Digital I/O functions enable you to generate or read digital signals using your hardware. You can create digital I/O objects, add lines, send data to the hardware, and read data into the workspace. The toolbox supports clocked digital I/O using the session-based interface. The legacy interface of the toolbox provides support for static acquisition and control.

Counter/Timer

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.

MATLAB code used to acquire data from a DAQ device with counter/timer channels

MATLAB code used to acquire data from a DAQ device with counter/timer channels.

Audio Input and Output

Audio input and audio output functions let you acquire and generate signals using built-in or external sound card. You can create an audio input object, add multiple audio channels to the object, acquire data to memory, read data into the workspace, and preview the most recently acquired audio data.

Next: Controlling Your Acquisition

Try Data Acquisition Toolbox

Get trial software

バイオメディカルシリーズ: これからはじめる、MATLABによる生体信号の取得と可視化

View webinar