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.

  1. Create a device object -- Create the analog output object ao for a sound card.
  2. Add channels -- Add two hardware channels to ao.
  3. Configure property values -- Configure the sampling rate to 44.1 kHz for each channel.
  4. 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.
  1. Start the output. When all the data is output, ao automatically stops executing.

  1. 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