| Data Acquisition Toolbox | ![]() |
Example: Queuing Data with putdata
This example illustrates how you can use putdata to queue 8000 samples, and then output the data a total of five times using the RepeatOutput property.
You can run this example by typing daqdoc6_3 at the MATLAB command line.
AO for a sound card. The installed adaptors and hardware IDs are found with daqhwinfo.
AO.
putdata calls. Because the queued data is repeated four times and two putdata calls are issued, a total of 10 seconds of data is output.
duration = 1; set(AO,'SampleRate',8000) ActualRate = get(AO,'SampleRate'); len = ActualRate*duration; set(AO,'RepeatOutput',4) data = sin(linspace(0,2*pi*500,len))'; putdata(AO,data) putdata(AO,data)
AO and wait for the device object to stop running.
AO, you should remove it from memory and from the MATLAB workspace.
| Queuing Data with putdata | Configuring Analog Output Triggers | ![]() |