Data Acquisition Toolbox

Live Data Acquisition, Signal Processing and Data Output

The Data Acquisition Toolbox provides Simulink blocks for acquiring live data into Simulink models and for outputting live signals to the physical hardware.

This example uses the Analog Input block to acquire live analog data from a data acquisition device into Simulink. The acquired data is processed in Simulink and uses the Analog Output block to output data to an analog data acquisition device. This example demonstrates how a Simulink model can communicate with multiple pieces of hardware in the same model. In this case, the data acquisition devices used are from Measurement Computing Corporation (MCC) and National Instruments (NI).


Watch the system response (0:05)

Live Data Input

The input signals are acquired from an MCC data acquisition device (USB-1616FS). Signals are acquired from three channels at the rate of 30 samples/second.

Signal Processing

The acquired data is quantized, and processed using a switch whose output value depends on the square trigger input. A weighted moving average block is used to determine the output signal. The processing algorithm can be simple or complex depending on your process.

Live Data Output

The processed data is output to a single channel of a National Instruments device (PCI-6251) at a rate of 30 samples/second. A plot of the input and the output signals are shown below.

Even though Measurement Computing and National Instruments devices were used for this example, this model can be easily updated to connect your models to other supported data acquisition devices. This provides you the flexibility to use the same Simulink model with different data acquisition hardware.