Main Content

daq.getDevices

(Not recommended) Display available data acquisition devices

Description

daq.getDevices lists devices available to your system.

Tips

  • Devices not supported by the toolbox are denoted in the output list with an asterisk (*). For a complete list of supported devices, see https://www.mathworks.com/hardware-support/data-acquistion-software.html.

  • To suppress diagnostic information from daq.getDevices about inoperational vendors, run the function disableVendorDiagnostics. To turn these diagnostics back on, run enableVendorDiagnostics.

device = daq.getDevices assigns the device list to the variable device.

example

Examples

collapse all

Get a list of all devices available to your system and store it in the variable d.

 d = daq.getDevices
d = 

index   Vendor    Device ID                            Description                           
----- ----------- --------- -----------------------------------------------------------------
1     directsound Audio0    DirectSound Primary Sound Capture Driver
2     directsound Audio1    DirectSound Digital Audio (S/PDIF) (High Definition Audio Device)
3     directsound Audio3    DirectSound HP 4120 (2- HP 4120)
4     ni          cDAQ1Mod1 National Instruments NI 9205
5     ni          cDAQ1Mod2 National Instruments NI 9263
6     ni          cDAQ1Mod3 National Instruments NI 9234
7     ni          cDAQ2Mod1 National Instruments NI 9402
8     ni          cDAQ2Mod2 National Instruments NI 9205
9     ni          cDAQ2Mod3 National Instruments NI 9375
10    ni          Dev1      National Instruments USB-6211
11    ni          Dev2      National Instruments USB-6218
12    ni          Dev3      National Instruments PCI-6255
13    ni          PXI1Slot2 National Instruments PXI-4461
14    ni          PXI1Slot3 National Instruments PXI-4461

To get detailed information about a particular device or a module in a chassis, type d(index). For example, to get information about the NI 9402, which has the index 7, type:

 d(7)
ans = 

ni: National Instruments NI 9402 (Device ID: 'cDAQ2Mod1')
   Counter input subsystem supports:
      Rates from 0.1 to 80000000.0 scans/sec
      4 channels ('ctr0','ctr1','ctr2','ctr3')
      'EdgeCount','PulseWidth','Frequency','Position' measurement types
   
   Counter output subsystem supports:
      Rates from 0.1 to 80000000.0 scans/sec
      4 channels ('ctr0','ctr1','ctr2','ctr3')
      'PulseGeneration' measurement type
   
This module is in slot 1 of the 'cDAQ-9178' chassis with the name 'cDAQ2'.

You can also click on the name of the device in the list to access detailed device information, which includes:

  • subsystem type

  • rate

  • number of available channels

  • measurement type

View information about devices by examining device object properties.

Discover available devices.

d = daq.getDevices
d = 

Data acquisition devices:

index Vendor Device ID          Description         
----- ------ --------- -----------------------------
1     ni     cDAQ1Mod1 National Instruments NI 9201
2     ni     cDAQ2Mod1 National Instruments NI 9201
3     ni     Dev1      National Instruments USB-6211
4     ni     Dev2      National Instruments USB-6218
5     ni     Dev3      National Instruments USB-6255
6     ni     Dev4      National Instruments USB-6363
7     ni     PXI1Slot2 National Instruments PXI-4461
8     ni     PXI1Slot3 National Instruments PXI-4461 

Examine properties of the NI 9201, with the device id cDAQ1Mod1 at index 1.

d(1)
ans = 

ni: National Instruments NI 9201 (Device ID: 'cDAQ1Mod1')
   Analog input subsystem supports:
      -10 to +10 Volts range
      Rates from 0.1 to 800000.0 scans/sec
      8 channels ('ai0','ai1','ai2','ai3','ai4','ai5','ai6','ai7')
      'Voltage' measurement type
   
This module is in slot 4 of the 'cDAQ-9178' chassis with the name 'cDAQ1'.

Properties, Methods, Events

Click the Properties link to see the properties of the device object.

  ChassisName: 'cDAQ1'
    ChassisModel: 'cDAQ-9178'
      SlotNumber: 4
     IsSimulated: true
       Terminals: [48x1 cell]
          Vendor: National Instruments
              ID: 'cDAQ1Mod1'
           Model: 'NI 9201'
      Subsystems: [1x1 daq.ni.AnalogInputInfo]
     Description: 'National Instruments NI 9201'
RecognizedDevice: true

Note that the IsSimulated value is true, indicating that this device is simulated.

Discover available devices.

d = daq.getDevices
d = 

Data acquisition devices:

index Vendor Device ID          Description          
----- ------ --------- ------------------------------
1     ni     cDAQ1Mod1 National Instruments NI 9205
2     ni     cDAQ1Mod2 National Instruments NI 9263
3     ni     cDAQ1Mod3 National Instruments NI 9234
4     ni     cDAQ1Mod4 National Instruments NI 9201
5     ni     cDAQ1Mod5 National Instruments NI 9402
6     ni     cDAQ1Mod6 National Instruments NI 9213
7     ni     cDAQ1Mod7 National Instruments NI 9219
8     ni     cDAQ1Mod8 National Instruments NI 9265

Access the Terminals property of the NI 9205 at index 1.

d(1).Terminals
ans = 

    'cDAQ1/PFI0'
    'cDAQ1/PFI1'
    'cDAQ1/20MHzTimebase'
    'cDAQ1/80MHzTimebase'
    'cDAQ1/ChangeDetectionEvent'
    'cDAQ1/AnalogComparisonEvent'
    'cDAQ1/100kHzTimebase'
    'cDAQ1/SyncPulse0'
    'cDAQ1/SyncPulse1'
        ⋮

Output Arguments

collapse all

Device list, returned as an array of DeviceInfo objects.

Version History

Introduced in R2010b

collapse all

R2020a: daq.getDevices is not recommended

Use of this function not recommended. Use daqlist instead.

For more information about using the recommended functionality, see Transition Your Code from Session to DataAcquisition Interface.

Go to top of page