Data Acquisition Toolbox    

Reading and Writing Digital Values

If you have a supported National Instruments board with at least eight digital I/O lines, you can run the following example, which outputs digital values, and then reads back those values.

You should modify this example to suit your specific application needs. If you want detailed information about reading and writing digital values, refer to Digital Input/Output.

  1. Create a device object -- Create the digital I/O object dio for a National Instruments PCI-6024E board with hardware ID 1.
  2. Add lines -- Add eight hardware lines to dio, and configure them for output.
  3. Read and write values -- Create an array of output values, and write the values to the digital I/O subsystem. Note that reading and writing digital I/O line values typically does not require that you configure specific property values.
  4. Clean up -- When you no longer need dio, you should remove it from memory and from the MATLAB workspace.


  Outputting Data Understanding the Toolbox Capabilities