Troubleshooting Instrument Drivers

Updated Jun 4, 2018

Reported In

Software

  • LabVIEW
  • LabWindows/CVI
  • Measurement Studio Instrument Driver Toolkit
  • Measurement Studio
  • Measurement & Automation Explorer (MAX)

Driver

  • NI-VISA
  • NI-Serial
  • NI-488.2
  • IVI Compliance Package

Programming Language

  • C
  • LabVIEW G

Issue Details

  • I have downloaded an Instrument Driver from IDNet and it is not behaving as expected.
  • I am using a Plug-and-Play instrument driver in a LabVIEW project, and when I move from one LabVIEW version to another the instrument driver library is not found correctly.
  • Which software and drivers do I need to have in order to control third-party instruments with National Instruments products?
  • I'm using benchtop instruments (multimeter, scope, power supply, etc), and I can't see them in NI MAX.
  • I see the COM serial port in my computer, but I can't talk with my instrument.

Solution

Before attempting the next steps, make sure you have the instrument manual, and that your instrument works properly when not controlled programmatically. Additionally, it's a good idea to double check your connection from the computer to the instrument.
 

A. Verify you have the correct drivers in your computer


1. Check the instrument driver's readme or download page for required software and any other special instructions.

 

2. Confirm you have installed the National Instruments software required to communicate with your device: Determine the Version of the NI Software Installed on My Computer. You also want to confirm the software was installed in the correct order: Installation Order for Multiple NI Software Products. Make sure you check the readme file, included in each download page, and in the installation media, to determine if it is compatible with your computer. Examples of required software include:

 

  1. NI-Serial (for instruments using serial communication)
  2. NI-488.2 (for instruments using GPIB communications)
    You must install NI-488.2 driver software before installing any new NI GPIB hardware devices so Windows can detect them.
  3. NI-VISA
  4. IVI Compliance Package (for instruments using IVI compliant commands)
  5. NI Modular Instrument Drivers (NI-SCOPE, NI-DMM, etc)
  6. Among others…

 

For more information regarding the software used, refer to: Instrument Control Fundamentals: Instrument Control Software.

 

3. Confirm successful communication through NI-VISA (or other supporting software). Getting Started with Instrument Control, and Instrument Control: Set Up Hardware will walk you through this process.

 

B. Verify your instrument driver installation


Confirm that your instrument driver is installed correctly. You can find all instrument drivers in the Instrument Driver Network (IDNet):
 

  • For LabVIEW Plug and Play instruments: LabVIEW Plug and Play instrument drivers should be located under the <LabVIEW>/instr.lib directory.  (For example: C:\Program Files (x86)\National Instruments\LabVIEW 2017\instr.lib\Agilent 34401) Plug and Play instrument drivers do not have installers, they just need to be extracted into instr.lib.  When extracting them, make sure that your extraction software does not create an additional folder layer (For example: C:\Program Files (x86)\National Instruments\LabVIEW 2017\instr.lib\Agilent 34401\Agilent 34401).
  • For LabWindows™/CVI Plug and Play instruments: LabWindows™/CVI Plug and Play instrument drivers just need to have the source code referenced properly in the project that you create. They do not have installers and just need to be extracted.
  • For instruments that use IVI drivers: IVI Instrument Specific instrument drivers should be installed in the IVIStandardRoot directory(s). (For example: C:\Program Files\IVI Foundation\IVI\Drivers)  If the IVI Instrument Specific instrument driver is maintained by NI, it will also create IVI driver entries in MAX, as shown in the image below.
 


Note: If you will be using IVI-C Class Drivers, you will need to configure the IVI Logical Name and Driver session in MAX and then Save the settings. Refer to the next document for those instructions: Getting Started Using National Instruments IVI with LabVIEW or LabWindows™/CVI

 

C. Verify your instrument works in your Application Development Environment (ADE)


1. Try communicating through a simple VISA example to confirm that VISA is working through the ADE (LabVIEW, LabWindows™/CVI, Measurement Studio). Open the example finder Help»Find Examples, then navigate to Hardware I/O and select the type of connection you are using: GPIB or Serial.

 

2. Open the ADE that you will be using and find an example for the instrument driver:
 

  • For LabVIEW PnP (project-style): you will need to run the Example Finder: Help»Find Examples, then navigate to Hardware I/O»Instrument Drivers»LabVIEW Plug and Play
  • For IVI-C Drivers: create a CVI project and add the driver files and example to the project. The files can be found at <IVIStandardRootDir>/Drivers.
  • For CVI PnP: just open up the .prj file and run the example.
  • For IVI-C Class Drivers:
    • In LabVIEW, use the example finder: Help»Find Examples, then navigate to Hardware I/O»Instrument Drivers»IVI
    • In LabWindows™/CVI, use the example finder: Help»Find Examples, then navigate to Hardware I/O»Instrument Drivers»IVI

 

3. Confirm that you are using the correct VISA resource or IVI Logical Name and run the example. If the example does not run correctly, try the following:
 

  1. Just running with Initialize and Close commands.
  2. Disable IDQuery.
  3. Restart the computer and re-confirm VISA communication using the VISA Test Panel in NI MAX.
  4. See if the problem reproduces on another computer or with an identical instrument.
  5. If using IVI, try using the Specific Driver directly (plug and play style) instead.

 

4. If you can communicate through the instrument driver, but see a problem, isolate the problem down to the minimum number of VIs or function calls that reproduce the error.

  1. See if the problem persists in highlight execution mode (LabVIEW only) or single-stepping.
  2. Confirm that you are closing the instrument driver reference at the end of your application.
  3. Search for the error code you get in the National Instrument's website and forums.

Additional Information

Most common reasons for incorrect instrument driver behavior

 
  • The commands are incomplete or incorrect.
  • The instrument model/revision is not supported by the instrument driver.
  • The communication settings are not correct in the instrument driver (most common in RS-232).
  • The values being passed by the user application are out of range.
  • The instrument driver is not installed or configured correctly.
  • The particular instrument model that you are using is supported by the driver, but was not available for testing.
  • The instrument control bus that you are using is not supported by the instrument driver (most common with RS-232).
  • The IVI driver is in simulation mode, and you do not expect it to be.
 

 

Additional troubleshooting steps

 

  • Take an NI I/O Trace capture of the error occurring. Review the document: Performing a Good NI I/O Trace Capture for Debugging/Troubleshooting.
    • Based on the error information and NI I/O Trace capture, look at the VI or function where the error is being reported from.
  • Look at the commands being sent and compare them to the programming manual. If the commands being sent do not match those in the programming manual, try changing them and see if that resolves the issue.
  • If the Instrument Driver is NI-Supported, collect the following information and contact NI support:
    • Operation System version and bitness
    • ADE version, type, and bitness
    • Instrument Driver name, version, and bitness
    • Exact instrument model, revision, and firmware version
    • Is the instrument listed as being supported by the instrument driver?
    • Was the instrument driver working well before? If yes, what has changed since then?
    • When was successful VISA communication last confirmed?
    • What error codes are being generated and what did you find when looking them up on ni.com?
    • Does the problem reproduce on other computers?
    • Does the problem reproduce with other identical instruments?
    • Instrument control bus being used (USB, GPIB, Serial, etc.). Does the problem occur in all the instrument's communication buses?
  • If the instrument driver is not NI-Supported, try posting your problem to the NI Discussion Forums or contacting the instrument driver vendor for support.
  • If available, try a different instrument driver.
  • If using an IVI Driver, see if the problem occurs when simulating a device, or when range checking is turned off.


 

National Instruments Driver refers to the software that facilitates the communication between National Instruments hardware and software. For example: The Virtual Instrument Software Architecture API, commonly referred to as NI-VISA, allows communication with most instrumentation buses including GPIB, USB, Serial, and Ethernet. It provides a consistent and easy to use command set to communicate with a variety of instruments.

 

Instrument Driver refers to a set of software routines that control a programmable instrument. Each routine corresponds to a programmatic operation such as configuring, reading from, writing to, and triggering the instrument. Instrument drivers simplify instrument control and reduce test program development time by eliminating the need to learn the programming protocol for each instrument.

WAS THIS ARTICLE HELPFUL?

Not Helpful