Discover MCC Devices Using the Session-Based Interface

This example shows how to discover devices visible to MATLAB® and get information about channel and measurement types available in those devices.

Display a List of Available Vendors

Use the daq.getVendors command to display a list of vendors available to your machine and MATLAB.

v = daq.getVendors
v = 

Number of vendors: 2

index ID  Operational           Comment          
----- --- ----------- ---------------------------
1     ni  true        National Instruments
2     mcc true        Measurement Computing Corp.

Display a List of Available Devices

Use the daq.getDevices command to display a list of devices available to your machine and MATLAB.

d = daq.getDevices
d = 

Data acquisition devices:

index Vendor Device ID                 Description                
----- ------ --------- -------------------------------------------
1     mcc    Board0    Measurement Computing Corp. USB-1208FS-Plus
2     mcc    Board1    Measurement Computing Corp. USB-1208LS
3     mcc    Board2    Measurement Computing Corp. PMD-1208FS
4     mcc    Board3    Measurement Computing Corp. USB-1408FS
5     mcc    Board4    Measurement Computing Corp. USB-1616HS-4
6     mcc    Board5    Measurement Computing Corp. USB-1608HS-2AO

Get Details About a Device

The daq.getDevices command shows you the overview of devices available. You can run the following command or click the corresponding "Device ID" hyperlink in the Command window to get details of the device.

deviceInfo = d(1)
deviceInfo = 

mcc: Measurement Computing Corp. USB-1208FS-Plus (Device ID: 'Board0')
   Analog input subsystem supports:
      8 ranges supported
      Rates from 0.1 to 50000.0 scans/sec
      8 channels ('Ai0' - 'Ai7')
      'Voltage' measurement type
   Analog output subsystem supports:
      0 to +5.0 Volts range
      Rates from 1.0 to 50000.0 scans/sec
      2 channels ('Ao0','Ao1')
      'Voltage' measurement type

Get More Details About this Device

Use get to see more details for the device.

                               Vendor: Measurement Computing Corp.
                                   ID: 'Board0'
                                Model: 'USB-1208FS-Plus'
                           Subsystems: [1x2 daq.AnalogSubsystemInfo]
DisplayInoperationalVendorDiagnostics: true
                          Description: 'Measurement Computing Corp. USB-1208FS-Plus'
                     RecognizedDevice: true

Display Subsystems of a Device

Use the Subsystems property to find all the subsystem information. To display all details about the first subsystem including the channel, type:

       CouplingsAvailable: DC
               SampleType: Scanning
 TerminalConfigsAvailable: Differential,SingleEnded
          RangesAvailable: -20 to +20 Volts,-10 to +10 Volts,-5.0 to +5.0 Volts,-4.0 to +4.0 Volts,-2.5 to +2.5 Volts,-2.0 to +2.0 Volts,-1.3 to +1.3 Volts,-1.0 to +1.0 Volts
               Resolution: 12
                RateLimit: [0.1 50000.0]
MeasurementTypesAvailable: [1x1 cell]
   DefaultMeasurementType: 'Voltage'
           NativeDataType: 'double'
            SubsystemType: AnalogInput
NumberOfChannelsAvailable: 8
             ChannelNames: [1x8 cell]

Dynamic Hardware Discovery

When you change your hardware configuration (for example, plug in a new USB device), first use the daqreset command to refresh Data Acquisition toolbox. Then, detect the device in InstaCal before using daq.getDevices to discover the changes.