daqhwinfo

Data acquisition hardware information

Syntax

out = daqhwinfo
out = daqhwinfo('adaptor')
out = daqhwinfo('adaptor','FieldName')
out = daqhwinfo(obj)
out = daqhwinfo(obj,'FieldName')

Arguments

'adaptor'

The hardware driver adaptor name. The supported adaptors are advantech, mcc, nidaq, parallel, and winsound.

obj

A device object or array of device objects.

'FieldName'

A single field name or a cell array of field names.

out

A structure containing the requested hardware information.

Description

out = daqhwinfo returns general hardware-related information as a structure to out. The returned information includes installed adaptors, the toolbox and the MATLAB software version, and the toolbox name.

out = daqhwinfo('adaptor') returns hardware-related information for the specified adaptor. The returned information includes the adaptor DLL name, the board names and IDs, and the device object constructor syntax.

    Note:   If you are trying to discover National Instruments® including CompactDAQ or Counter/Timer subsystem devices, use the daq.getDevices method.

out = daqhwinfo('adaptor','FieldName') returns the hardware-related information specified by FieldName for adaptor. FieldName must be a single string. out is a cell array. You can return a list of valid field names with the daqhwinfo('adaptor') syntax.

out = daqhwinfo(obj) returns hardware-related information for the device object obj. If obj is an array of device objects, then out is a 1-by-n cell array of structures where n is the length of obj. The returned information depends on the device object type, and might include the maximum and minimum sampling rates, the channel gains, the hardware channel or line IDs, and the vendor driver version.

out = daqhwinfo(obj,'FieldName') returns the hardware-related information specified by FieldName for the device object obj. FieldName can be a single field name or a cell array of field names. out is an m-by-n cell array where m is the length of obj and n is the length of FieldName. You can return a list of valid field names with the daqhwinfo(obj) syntax.

Examples

Display all installed adaptors. Note that this list might be different for your platform.

out = daqhwinfo;
out.InstalledAdaptors
ans = 
    'advantech'
    'mcc'
    'nidaq'
    'parallel'
    'winsound'

To display the device object constructor names for all installed winsound devices:

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

Create the analog input object ai for a sound card. To display the input ranges for ai:

ai = analoginput('winsound');
out = daqhwinfo(ai);
out.InputRanges
ans =
    -1     1

To display the minimum and maximum sampling rates for ai:

out = daqhwinfo(ai,{'MinSampleRate','MaxSampleRate'})
out = 
    [8000]    [44100]

    Notes   The Traditional NI-DAQ adaptor will be deprecated 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.

    The Parallel adaptor will be deprecated 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.

More About

expand all

Tips

As shown below, you can also return hardware information via the Workspace browser by right-clicking a device object, and selecting Display Hardware Info from the context menu.

Was this topic helpful?