Skip to Main Content Skip to Search
Product Documentation

Session-Based Interface Using National Instruments Devices

Session-Based Interface and Legacy Interface

You can use National Instruments devices with both the session-based interface and the legacy interface. To see which interface you need to use, refer to National Instruments Usage Based on Functionality. For more information on the session-based information, see Using the Session-Based Interface.

daqhwinfo('nidaq')
           AdaptorDllName: [1x63 char]
        AdaptorDllVersion: '3.0 (R2011b)'
              AdaptorName: 'nidaq'
               BoardNames: {'PCI-4472'}
        InstalledBoardIds: {'Dev4' '1'}
    ObjectConstructorName: {2x3 cell}

If the daqhwinfo('nidaq') command returns a warning about session-based interface, you have devices that require the session-based interface.

 daqhwinfo('nidaq')

Warning: Devices were detected that require the DAQ Session Based Interface.
For more information, see documentation on the session-based interface
 

ans = 

           AdaptorDllName: [1x103 char]
        AdaptorDllVersion: '3.0 (R2011b)'
              AdaptorName: 'nidaq'
               BoardNames: {1x13 cell}
        InstalledBoardIds: {1x13 cell}
    ObjectConstructorName: {13x3 cell}

Refer to Introduction to the Session-Based Interface to learn how to communicate with CompactDAQ devices.

Hardware Driver Version

Data Acquisition Toolbox software is compatible only with specific versions of the NI-DAQ driver and is not guaranteed to work with any other versions. For a list of the NI-DAQ driver versions that are compatible with Data Acquisition Toolbox software, refer to the product page on the MathWorks Web site at http://www.mathworks.com/products/daq/supportedio.html and click on the link for this vendor.

To see your installed driver version in the session-based interface, type:

v = daq.getVendors

v = 

Data acquisition vendor 'National Instruments':

            ID: 'ni'
      FullName: 'National Instruments'
AdaptorVersion: '3.0 (R2011b Prerelease)'
 DriverVersion: '9.2.3 NI-DAQmx'
 IsOperational: true

If the version in the DriverVersion field does not match the minimum requirements specified on the product page on the MathWorks Web site, you need to update your drivers.

If your driver is incompatible with Data Acquisition Toolbox , verify that your hardware is functioning properly before updating drivers. If your hardware is not functioning properly, you are using unsupported drivers. Visit the National Instruments Web site at http://www.ni.com/ for the latest NI-DAQ drivers.

To find driver version in the National Instruments' Measurement & Automation Explorer: . .

  1. Click Start > Programs > National Instruments > Measurement & Automation Explorer.

  2. Select Help > System Information.

Hardware Performance

Use the Test Panel to troubleshoot your National Instruments hardware . The Test Panel allows you to test each subsystem supported by your device, and is installed as part of the NI-DAQmx driver software. Right-click the device in the Measurement & Automation Explorer and choose Test Panel.

For example, to verify that the analog input subsystem on your PCIe-6363 device is operating, . connect a known signal (similar to that produced by a function generator) to one or more channels, using a screw terminal panel.

If the Test Panel does not provide you with the expected results for the subsystem, and you are sure that your test setup is configured correctly, then the hardware is not performing correctly.

For your National Instruments hardware support visit their Web site at http://www.ni.com/.

Cannot Create Session

If you try to create a session using daq.createSession, and you see the following error:

??? The vendor 'ni' is not known. Use 'daq.getVendors()' for a list of vendors.
  1. get vendor information by typing:

    v = daq.getVendors
    
    v = 
    
    Data acquisition vendor 'National Instruments':
    
                ID: 'ni'
          FullName: 'National Instruments'
    AdaptorVersion: '2.17 (R2010b)'
     DriverVersion: '9.1 NI-DAQmx'
     IsOperational: true
    

    If you do not see output like the one shown, see .

Session was Deleted

This warning:

A session was deleted while it was running.

occurs when you start background operations in the session and the session is silently deleted. This could be caused by the session going out of scope at the end of a MATLAB function, before the background task completes. To avoid this, insert a pause after daq.session.startBackground.

Cannot Find Vendor

If you try to get vendor information using daq.getVendors in the session-based interface, and receive one of the following errors:

Cannot Find Devices

If you try to find information using daq.getDevices and:

Reserved Hardware

If you receive the following error:

??? The hardware associated with this session is reserved. If you are using it in another 
session use the release function to unreserve the hardware. If you are using it in an 
external program exit that program. Then try this operation again. 

Identify the session that is currently not using this device, but has reserved it and release the associated hardware resources. If the device is reserved by:

Another session in the current MATLAB program.

Do one of the following:

  • Use daq.Session.release to release the device from the session that is not using the device.

  • Delete the session object.

Another session in a separate MATLAB program.

Do one of the following:

  • Use daq.Session.release to release the device from the session that is not using the device.

  • Delete the session object.

  • Exit the MATLAB program.

Another application.

Exit the other application.

In none of these measures work, reset the device from NI MAX.

Unsupported Devices

If you get device information and see a device listed with an asterisk (*) next to it, then the toolbox does not support this device.

d = daq.getDevices

d = 

Data acquisition devices:

index Vendor Device ID           Description          
----- ------ --------- -------------------------------
1     ni     cDAQ1Mod1 National Instruments NI 9401
2     ni     cDAQ1Mod7 National Instruments NI 9219
3     ni     cDAQ2Mod1 National Instruments NI 9205
4     ni     cDAQ2Mod2 National Instruments NI 9263
5     ni     cDAQ2Mod3 National Instruments NI 9203
6     ni     cDAQ2Mod4 National Instruments NI 9201
7     ni     cDAQ2Mod5 National Instruments NI 9265
8     ni     cDAQ2Mod6 National Instruments NI 9213
9     ni     cDAQ2Mod7 National Instruments NI 9227
10    ni     cDAQ2Mod8 National Instruments NI 9422
11    ni     Dev2      National Instruments PCIe-6363
12    ni     Dev3      National Instruments USB-6255
13    ni     Dev4      National Instruments USB-9233
14    ni     Dev5      * National Instruments PCI-6601
15    ni     Dev6      National Instruments PCI-6220
16    ni     Dev8      * National Instruments PCI-6509

* Device currently not supported. See documentation on Unsupported Devices for more information.

Network Devices

ADC Overrun Error with External Clock

If you see this error when you synchronize acquisition using an external clock:

ADC Overrun Error: If you are using an external clock, make sure that the clock frequency matches session rate. 

Cannot Add Clock Connection

When you try to synchronize operations using a PXI 447x series device, you will see this error:

"DSA device 'PXI1Slot2' does not support sample clock synchronization. Check device's user manual.

National Instruments DSA devices like the PXI 447x, do not support sample clock synchronization. You cannot currently synchronize these devices in the session-based interface using daq.Session.addClockConnection.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS