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, seehttps://www.mathworks.com/hardware-support/data-acquistion-software.html
.To suppress diagnostic information from
daq.getDevices
about inoperational vendors, run the functiondisableVendorDiagnostics
. To turn these diagnostics back on, runenableVendorDiagnostics
.
assigns the device
list to the variable device
= daq.getDevicesdevice
.
Examples
Get a List of Devices
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
Examine Device Properties
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
device
— Device list
array of DeviceInfo
objects
Device list, returned as an array of DeviceInfo
objects.
Version History
Introduced in R2010bR2020a: 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.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: United States.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)