Cornell University
BioNB 441
Using the Matlab DAQ
Introduction
The Data Aqusition (daq) Toolbox is a set of Matlab extensions which allow almost real-time control of external instruments and recording of electical signals. This toolbox has to handle the interface between a purely software environment (Matlab) and the real world of wires and voltages. There are several pieces to the interface:
The daq toolbox gives you a way to add computer control to your experiments. Possible uses for the daq toolbox include:
Examples
SimpleAO.m produces a computed series of waveforms. However, the program
suffers from a short time gap (a few milliseconds) between each waveform.
To obtain continuous tones, you can use the technique shown in simpleAOcontinuous.m.
Here the waveforms are computed as separate columns of an array, then reshaped
into one column for faster output. There is still a problem, however. There
is a test near the end of the program which waits for output to finish before
the output object is deleted. The code sits in this 'while loop' and does
not let any other Matlab program execute. So if you are watching the output
with a program like scope3 (described below) then scope3 freezes until simpleAOcontinuous.m
is done. One solution is shown in simpleAOcontinuous2.m.
Rather than using program code to wait for completion, the daq 'stopaction'
is set to delete. This seems to work, although I can't find documentation
to suggest that it should work. If you need to delete a bunch of analog
outputs, but leave any existing inputs intact use:
existingAO=daqfind('name','winsound0-AO'); for i=1:length(existingAO) delete(existingAO{i}); end