Documentation Center

  • Trial Software
  • Product Updates

Examine Your Hardware Resources

Using the daqhwinfo Function

You can examine the data acquisition hardware resources visible to the toolbox with the daqhwinfo function. Hardware resources include installed boards, hardware drivers, and adaptors. The information returned by daqhwinfo depends on the supplied arguments, and is divided into three categories described in this section.

If you configure hardware parameters using a vendor tool such as National Instruments® Measurement and Automation Explorer or Measurement Computing™ InstaCal, daqhwinfo will return this configuration information. For example, if you configure your Measurement Computing device for 16 single-ended channels using InstaCal, daqhwinfo returns this configuration. However, the toolbox does not preserve configuration information that is not directly associated with your hardware. For example, channel name information is not preserved. Refer to Troubleshooting Your Hardware for more information about using vendor tools.

General Toolbox Information

To display general information about the toolbox, enter:

out = daqhwinfo
out = 
          ToolboxName: 'Data Acquisition Toolbox'
       ToolboxVersion: '2.2 (R13)'
        MATLABVersion: '6.5 (R13)'
    InstalledAdaptors: {4x1 cell}

The InstalledAdaptors field lists the hardware driver adaptors installed on your system. To display the installed adaptors, enter:

out.InstalledAdaptors
ans = 
    'mcc'
    'nidaq'
    'parallel'
    'winsound'

This information tells you that an adaptor is available for Measurement Computing and National Instruments devices, parallel ports, and sound cards.

    Notes   The list of installed adaptors might differ for your platform. Toolbox adaptors are available to you only if the associated hardware driver is installed.

    Support for the Traditional NI-DAQ adaptor will be removed in a future version of the toolbox. If you create a Data Acquisition Toolbox™ object for Traditional NI-DAQ adaptor beginning in R2008b, you will receive a warning stating that this adaptor will be removed in a future release.

    Support for the Parallel adaptor will be removed in a future version of the toolbox. If you create a Data Acquisition Toolbox™ object for 'parallel' beginning in R2008b, you will receive a warning stating that this adaptor will be removed in a future release. See the supported hardware page at www.mathworks.com/products/daq/supportedio.html for more information.

Adaptor-Specific Information

To display hardware information for a particular vendor, you must supply the adaptor name as an argument to daqhwinfo. The supported vendors and adaptor names are given in Hardware Driver Adaptor. For example, to display hardware information for the winsound adaptor, use the legacy interface to enter:

out = daqhwinfo('winsound')
out = 
  AdaptorDllName: 'd:\v6\toolbox\daq\daq\private\mwwinsound.dll'
  AdaptorDllVersion: 'Version 2.2    (R13) 01-Jul-2002'
  AdaptorName: 'winsound'
  BoardNames: {'AudioPCI Record'}
  InstalledBoardIds: {'0'}	
  ObjectConstructorName:{'analoginput('winsound',0)'[1x26 char]}

The ObjectConstructorName field lists the subsystems supported by the installed sound cards, and the syntax for creating a device object associated with a given subsystem. To display the device object constructor names available for the AudioPCI Record board, enter:

out.ObjectConstructorName(:)
ans = 
    'analoginput('winsound',0)'
    'analogoutput('winsound',0)'

This information tells you that the sound card supports analog input and analog output objects. To create an analog input object for the sound card, enter:

ai = analoginput('winsound');

To create an analog output object for the sound card, enter:

ao = analogoutput('winsound');

If you have CompactDAQ device or a counter/timer device, see Session-Based Interface.

Device Object Information

To display hardware information for a specific device object, you supply the device object as an argument to daqhwinfo. The hardware information for the analog input object ai created in the Adaptor-Specific Information section is given below.

out = daqhwinfo(ai)
out = 
                AdaptorName: 'winsound'
                       Bits: 16
                   Coupling: {'AC Coupled'}
                 DeviceName: 'AudioPCI Record'
            DifferentialIDs: []
                      Gains: []
                         ID: '0'
                InputRanges: [-1 1]
              MaxSampleRate: 44100
              MinSampleRate: 8000
             NativeDataType: 'int16'
                   Polarity: {'Bipolar'}
                 SampleType: 'SimultaneousSample'
             SingleEndedIDs: [1 2]
              SubsystemType: 'AnalogInput'
              TotalChannels: 2
    VendorDriverDescription: 'Windows Multimedia Driver'
        VendorDriverVersion: '5.0'

    Note:   You cannot use the legacy interface on 64–bit MATLAB®. See Session-Based Interface to acquire and generate data.

Among other things, this information tells you that the minimum sampling rate is 8 kHz, the maximum sampling rate is 44.1 kHz, and there are two hardware channels that you can add to the analog input object.

Alternatively, you can return hardware information via the Workspace browser by right-clicking a device object, and selecting Explore > Display Hardware Info from the context menu.

Was this topic helpful?