main content

discover ni devices -凯发k8网页登录

this example shows how to discover national instruments devices visible to matlab® and get information about channel and measurement types available in those devices.

display a list of available devices

use daqlist to display a list of devices available to your machine and matlab.

d = daqlist("ni")
d =
  12×4 table
     deviceid                 description                    model             deviceinfo     
    ___________    __________________________________    _____________    ____________________
    "cdaq1mod1"    "national instruments ni 9205"        "ni 9205"        [1×1 daq.deviceinfo]
    "cdaq1mod2"    "national instruments ni 9263"        "ni 9263"        [1×1 daq.deviceinfo]
    "cdaq1mod3"    "national instruments ni 9234"        "ni 9234"        [1×1 daq.deviceinfo]
    "cdaq1mod4"    "national instruments ni 9201"        "ni 9201"        [1×1 daq.deviceinfo]
    "cdaq1mod5"    "national instruments ni 9402"        "ni 9402"        [1×1 daq.deviceinfo]
    "cdaq1mod6"    "national instruments ni 9213"        "ni 9213"        [1×1 daq.deviceinfo]
    "cdaq1mod7"    "national instruments ni 9219"        "ni 9219"        [1×1 daq.deviceinfo]
    "cdaq1mod8"    "national instruments ni 9265"        "ni 9265"        [1×1 daq.deviceinfo]
    "dev1"         "national instruments pcie-6363"      "pcie-6363"      [1×1 daq.deviceinfo]
    "dev2"         "national instruments ni elvis ii"    "ni elvis ii"    [1×1 daq.deviceinfo]
    "dev3"         "national instruments pcie-6363"      "pcie-6363"      [1×1 daq.deviceinfo]
    "dev4"         "national instruments pcie-6363"      "pcie-6363"      [1×1 daq.deviceinfo]

get details about a device

the daqlist command shows you the overview of devices available. to obtain more information about a particular device, view the "deviceinfo" table cell for it.

deviceinfo = d{1, "deviceinfo"}
deviceinfo = 
ni: national instruments ni 9205 (device id: 'cdaq1mod1')
   analog input supports:
      4 ranges supported
      rates from 0.6 to 250000.0 scans/sec
      32 channels ('ai0' - 'ai31')
      'voltage' measurement type
   
this module is in slot 1 of the 'cdaq-9178' chassis with the name 'cdaq1'.

dynamic hardware discovery

when the hardware configuration changes (for example, a new compactdaq module is plugged into the chassis), use daqreset followed by daqlist to observe the changes.

网站地图