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 check the physical 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 NI software required to communicate with your device: Software Required for Instrument Control (GPIB, Serial, VISA, USB, etc).
3. Make sure that if you need the drivers for development that you are not downloading the driver labelled "Runtime". The runtime version will allow the computer to detect the device but will not show configuration/debug options for it, such as VISA Test Panels.
4. Confirm successful communication through NI-VISA (or other supporting software). Getting Started with Instrument Control 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 NI 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:
- Just running with Initialize and Close commands.
- Disable IDQuery.
- Restart the computer and re-confirm VISA communication using the VISA Test Panel in NI MAX.
- See if the problem reproduces on another computer or with an identical instrument.
- 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.
- See if the problem persists in highlight execution mode (LabVIEW only) or single-stepping.
- Confirm that you are closing the instrument driver reference at the end of your application.
- 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.
NI Driver refers to the software that facilitates the communication between NI 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.