Data Acquisition Toolbox™ software consists of three distinct components:
The data acquisition engine
The hardware driver adaptors
As shown in the figure, these components allow you to pass information between the MATLAB® workspace and your data acquisition hardware.
The preceding diagram illustrates how information flows from component to component. Information consists of:
Property values – You can control the behavior of your data acquisition application by configuring property values. In general, you can think of a property as a characteristic of the toolbox or of the hardware driver that can be manipulated to suit your needs.
Data – You can acquire data from a sensor connected to an analog input subsystem and store it in the MATLAB workspace, or output data from the MATLAB workspace to an actuator connected to an analog output subsystem. Additionally you can transfer values (1s and 0s) between the MATLAB workspace and a digital I/O subsystem.
An event occurs at a particular time after a condition is met and
might result in one or more callbacks that you specify. Events can
be generated only after you configure the associated properties. Some
ways you can use events include initiating analysis after a predetermined
data is acquired, or displaying a message to the MATLAB workspace
after an error occurs.
Note: You cannot use the legacy interface on 64-bit MATLAB. See About the Session-Based Interface to acquire and generate data on a 64-bit MATLAB.
To perform any task with your data acquisition application, you must call MATLAB functions from the MATLAB environment. Among other things, these functions allow you to:
Create device objects, which provide a gateway to your hardware's capabilities and allow you to control the behavior of your application.
Acquire or output data.
Configure property values.
Evaluate your acquisition status and hardware resources.
Refer to the MATLAB Functions list in the Data Acquisition Toolbox Documentation Center for a list of all toolbox functions. You can also display all these functions by typing
If you are using a CompactDAQ chassis or counter timers, see Counter and Timer Input and Output.
The data acquisition engine (or just engine) is a MEX-file (shared library that is executable within the MATLAB software) that
Stores the device objects and associated property values that control your data acquisition application
Controls the synchronization of events
Controls the storage of acquired or queued data
While the engine performs these tasks, you can use MATLAB for other tasks such as analyzing acquired data. In other words, the engine and the MATLAB software are asynchronous. The relationship between acquiring data, outputting data, and data flow is described next.
Acquiring data means that data is flowing from your hardware
device into the data acquisition engine where it is temporarily stored
in memory, until you explicitly extract it using the
If you do not extract this data, and the amount of data stored
in memory reaches the limit for the data acquisition object (see
daqmem(obj)), a DataMissed event
occurs. At this point, the acquisition stops.
The rate at which the acquisition stops depends on several factors including the available memory, the rate at which data is acquired, and the number of hardware channels from which data is acquired.
The flow of acquired data consists of these two independent steps:
Data acquired from the hardware is stored in the engine.
Data is extracted from the engine and stored in the MATLAB workspace, or output to a disk file.
These two steps are illustrated below.
Outputting data means that data is flowing from the data acquisition
engine to the hardware device. However, before data is output, you
must queue it in the engine with the
The amount of data that you can queue depends on several factors including
the available memory, the number of hardware channels to which data
is output, and the size of each data sample.
The flow of output data consists of these two independent steps:
Data from the MATLAB workspace is queued in the engine.
Data queued in the engine is output to the hardware.
These two steps are illustrated below.
The hardware driver adaptor (or adaptor) is the interface between the data acquisition engine and the hardware driver. The adaptor's main purpose is to pass information between MATLAB and your hardware device via its driver.
Hardware drivers are provided by your device vendor. For example, to acquire data using a National Instruments® board, the appropriate version of the NI-DAQ driver must be installed on your platform. For further information about NI-DAQmx and Traditional NI-DAQ drivers, see NI-DAQmx Versus Traditional NI-DAQ Drivers. Hardware drivers are not installed as part of the toolbox with the exception of a special parallel port driver that allows access to the port's protected memory addresses. Additionally, a suitable driver is usually installed on PCs that are equipped with a sound card. For the remaining supported devices, the drivers must be installed.
You can obtain most adaptors either from MathWorks or from the
device vendors. See the supported hardware page at
a list of vendors whose hardware the toolbox supports, and for information
about how to obtain an adaptor. The toolbox provides the following
adaptors. The name of the vendor or device is also listed in the table.
Adaptor Provided by the Data Acquisition Device
Vendor or Device
National Instruments NI-DAQmx adaptors
National Instruments Traditional NI-DAQ adaptors
Windows® sound cards
Support for the Traditional NI-DAQ adaptor will be removed in
a future version of the toolbox. If you create a Data Acquisition
Toolbox™ object for Traditional NI-DAQ adaptor beginning in
R2008b, you will receive a warning stating that this adaptor will
be removed in a future release. See the supported hardware page at
Support for the Parallel adaptor will be removed in a future
version of the toolbox. If you create a Data Acquisition Toolbox™
Additional vendors not in this table are listed in the supported
hardware page at
Refer to the supported hardware page for Data Acquisition Toolbox software
the list of vendors whose hardware the toolbox supports, and for information
about how to obtain an adaptor. If the device you are using is not
listed on this page, you can do one of the following:
Contact the device vendor to request them to develop
an interface to the toolbox. Refer them to the supported hardware
a list of currently supported hardware and for information about contacting
Search for your device on the MathWorks support page
see if a solution is listed for using your unsupported device. Such
solutions are typically available for devices that the next Data Acquisition Toolbox release
Create the interface yourself. To interface unsupported hardware devices to the toolbox, use the Data Acquisition Toolbox Adaptor Kit installed with the toolbox. For more information about the adaptor kit, read the Adaptor Kit User's Guide in the PDF Documentation page for the Data Acquisition Toolbox.
Hire a consultant to write the interface or a systems
integrator to build the system. For a potential list of consultants
or systems integrators, go to the Third Party Products and Services
Consider using hardware that the toolbox already supports.