This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

Getting Started with Instrument Control

Updated Jan 3, 2019

Reported In

Hardware

  • USB Cable

Software

  • Measurement & Automation Explorer (MAX)

Driver

  • NI-VISA
  • NI-Serial
  • NI-488.2

Operating System

  • Windows

Issue Details

  • I've just started using a third party instrument. How do I connect to it and begin coding in LabVIEW?
  • My instrument is not responding when I attempt to communicate with it via micro-USB to USB cabling.
  • I looked up some LabVIEW Instrument Control code online. I made my own based off of that. And now, when I try to measure from the instrument, I always receive zeros.
  • Why am I only receiving zeros back from my instrument?

Solution

The following steps are the recommended initial troubleshooting steps when beginning with Instrument Control.

Ensure the computer has identified the 3rd party instrument.

  1. Open NI-MAX,
    1. Select View>>Refresh or press F5 to refresh the view.
    2. Expand the Devices and Interfaces in the system tree on the left-most window.
    3. Your USB instrument device should be listed here.
  2. If not identified in NI-MAX, troubleshoot your instrument in Windows Device Manager.
    • If not identified in NI-MAX nor Windows Device Manager, 
      1. Check the instrument's manual to determine which driver is required for Windows to communicate to the device
      2. Make sure the specified driver is installed on the computer.
      3. Troubleshoot the physical cable to determine it is not the issue
        • Ensure both ends are properly plugged-in to the device and your computer
        • Try another cable that you've successfully used in communicating with other instruments
        • Unplug and re-plug the cable back into the device and your computer


    Successfully communicate with the 3rd party instrument.

    • Open NI-MAX,
      1. Right click on the instrument under Devices and Interfaces
      2. Open a VISA Test Panel
      3. Under the Input/Output tab, perform a simple SCPI command.
        • i.e. Query the *IDN?\n command to identify the name of your instrument
    • Open LabVIEW,
      1. Open the example within NI Example Finder - Hardware Input and Output >> Serial >> Simple Serial*
      2. Create code from scratch, based on an online example with only VISA API's**


    Begin programming with your 3rd party instrument

    1. Check if the instrument has any available Instrument Drivers.
    2. If no Instrument drivers are available, build off of an existing example from NI Example Finder***
      • Simple GPIB.vi and Continuous Serial Write and Read.vi are great places to start****
     

    Getting Started Video Instructions

    The Getting Started with Instrument Control video series will walk you through similar steps as above. Note, the NI software is dated, but the principles still apply.

    Additional Information

    *     NI-Serial driver must be installed to find and open the Simple Serial .vi
    **    
    NI-VISA driver must be installed to find the VISA API's in the Functions Palette.
    ***   Remember to save the adjusted example file in a different location so that you do not alter the file saved in the NI Example File
    ****  NI-Serial driver and NI-488.2 driver must be installed to find and open the mentioned VI's

    WAS THIS ARTICLE HELPFUL?

    Not Helpful