Data Acquisition Toolbox |
 |
Outputting Data
If you have a sound card installed, you can run the following example, which outputs 1 second of data to two analog output hardware channels.
You should modify this example to suit your specific application needs. If you want detailed information about outputting data, refer to Analog Output.
- Create a device object -- Create the analog output object
ao
for a sound card.
- Add channels -- Add two hardware channels to
ao
.
- Configure property values -- Configure the sampling rate to 44.1 kHz for each channel.
- Output data -- Create 1 second of output data, and queue the data in the engine for eventual output to the analog output subsystem. You must queue one column of data for each hardware channel added.
- Start the output. When all the data is output,
ao
automatically stops executing.
- Clean up -- When you no longer need
ao
, you should remove it from memory and from the MATLAB workspace.
| Acquiring Data | | Reading and Writing Digital Values |  |