One of the greatest frustrations when getting started with instrument control is verifying communication with your instruments. You may spend hours sifting through lengthy manuals and layers of menus on the instrument trying to find information about the instrument address and whether GPIB is enabled.
To alleviate this frustration, National Instruments provides a number of productivity tools that help you speed through this important start-up process so you can begin focusing on the most important aspect of your application building your tests.
This application note describes various tools and techniques you can use to quickly get up and running with your GPIB instruments. Examples of how to use the interactive control utility, the LabVIEW Instrument Wizard, and Instrument I/O Assistant will provide you with the skills you need to quickly tackle your next GPIB test application.
Table of Contents
- Using the VISA Interactive Control (VISAIC) to Get Started
- Quickly Determining GPIB Addresses
- Establishing Communication with Your Instruments
- An Easy Way to Troubleshoot Instrument, Cable, and Power Problems
- LabVIEW Instrument Wizards Automate Interactive Control
- Scanning the System for Instruments
- Managing Instrument Drivers
- Opening an Example to Verify Communication
- Instrument I/O Assistant
1. Using the VISA Interactive Control(VISAIC) to Get StartedThe VISA Interactive Control (VISAIC), is a standard software utility included with National Instruments GPIB controller products. Using your computer, you can use this powerful development and debugging tool to interactively communicate (read, write, serial poll, etc.) with your GPIB instruments. With the VISAIC utility, you can speed up application development by learning how to automate measurements with your instruments, uncover GPIB problems, and avoid headaches by identifying malfunctioning instruments. For Windows platforms, the VISAIC utility comes complete with on-line help that describes the applicable NI-488 functions and NI-488.2 routines, syntax, error codes, and status variables that provide you with the debugging information you need to solve problems.
For a detailed discussion on how to use the VISAIC utility and the functions used in the examples, refer VISA help file and NI-488.2 help file, respectively, that came with your GPIB controller. The following sections assume a basic knowledge of the VISAIC utility and GPIB.
2. Quickly Determining GPIB Addresses
When VISAIC initially runs, it automatically finds all of the available resources in the system and lists the instrument descriptors for each resource under the appropriate resource type. The figure below shows the VISAIC opening window.
Figure 1. Visa Interactive Control
For instruments to be recognized, they must be powered on and connected to the GPIB controller via cable. If you have two or more instruments on the bus, you can disconnect all instruments except one to determine its address. By isolating each instrument on the bus and repeatedly Refreshing (View » Refresh) , you can quickly determine the address of each instrument. You could also use "Resource to Find" field and this will query each instrument for an identification (ID) string. ID querying is discussed in a section to follow.
3. Establishing Communication with Your Instruments
Once you have determined the GPIB address of your instruments, it is easy to establish communications to verify that you can send and receive data to and from the instrument. Because most instruments are 488.2 compliant, you can query the instrument for its identification by sending it “*IDN?.” Instruments will typically respond with the manufacturer’s name, model name, and various alphanumeric characters that the manufacturer uses to track firmware revisions. To communicate with our fictitious instrument at address 10, we will follow these instructions:
First, double-click the instrument in the VISAIC that you would like to communicate with, in our case GPIB1 :: 10::INSTR.
This will open up a VISA Test Panel for our instrument. This Test Panel will allow us to set properties for our instrument communication as well as read and write to the instrument.
Figure 2. VISA Test Panel
From the viWrite tab, if we put *IDN?\n and then click Execute. This will send the 488.2 identification command "*IDN?" to our instrument followed by a termination character "\n"
Now from the viRead tab, select a count of 100, the length of our expected response. and then hit execute, our instrument should return an identification string.
4. An Easy Way to Troubleshoot Instrument, Cable, and Power Problems
Many times systems are powered down and cables are disconnected from instruments for maintenance or to change the configuration of the system. Unfortunately, engineers sometimes forget to reconnect all the cables and power up all the instruments. Alternatively, system power may be disrupted for a variety of reasons or the actual instrument may begin to malfunction. VISAIC is also convenient for verifying that your instruments are still “alive” on the bus. Simply use the Refresh (View » Refresh) to check if a particular instrument is listening at its assigned GPIB address. If it is not, then you know to check cables, power, and verify that the instrument is working properly.
If there was a problem you would get no longer see your device, notifying you to check for loose or disconnected cables, power disruption, or a malfunctioning instrument.
The basic functions and concepts described above may seem simplistic; however they can be invaluable in troubleshooting and getting your GPIB system up and running. These productivity tools help you focus on developing your test applications to avoid frustration in trying to track down obscure problems or establishing communications with your instruments.
5. LabVIEW Instrument Wizards Automate Interactive Control
To get your job done, you need a fast way to find GPIB listeners and establish communication to ensure the GPIB system is working properly. Once this is done, you need a fast way of going from interactive mode to programming mode so you can directly begin writing your tests without a tedious transition process.
The LabVIEW Instrument Wizard addresses this by automating and integrating, directly inside of LabVIEW, some of the start-up tips discussed above. With the new instrument wizards, you save time in developing instrument control applications because LabVIEW automatically identifies the instruments connected, installs appropriate instrument driver libraries for programming, and then launches an application example to verify communication. The application example is generated using the installed instrument driver so you have a template from which to begin your own customized test applications.
The following is an example of how you might use the instrument wizard to start up your GPIB system. In this case we have added two unknown devices to the system.
6. Scanning the System for Instruments
Once you have launched the instrument wizard, LabVIEW scans the system for GPIB instruments as well as VXI, RS-232, and computer-based instruments. LabVIEW identifies new GPIB objects in the system as a device until you use the “Identify Device” button to query the device for more specific information. By default, “Identify Device” sends a “*IDN?” query to the instrument, you can still download instrument drivers if it does not respond to "*IDN?". LabVIEW then reads back the response of the device and updates the label in the instrument tree to reflect this information. In this case, we have identified one new instruments – a Fluke PM6685.
Figure 3. The Instrument Wizard
7. Managing Instrument Drivers
After you have identified the instruments in your system, LabVIEW can help you locate the appropriate Instrument Driver. Here you can search and download drivers as well as manage drivers. As you can see, we have additional instrument drivers already installed in our system for other Instrument. Instrument drivers are powerful pieces of software that combine the granular, low-level command strings needed for configuration and measurement into higher-level functions such as initialize, reset, and read waveform. Instrument libraries make instrument control easier and help you focus on taking measurements, developing complete tests, and making decisions, versus learning the nuts and bolts of how to make your instrument make a measurement. National Instruments provides a complete selection of the most popular instrument drivers requested by users today. For more information or to request additional instrument drivers visit the National Instruments Instrument Driver Network.
As you can see, the LabVIEW Instrument Wizard is designed to guide you through the discovery process of adding instrumentation to your system. By automating detection, query, and instrument driver installation, you can quickly get your system up and running and then begin focusing on building your actual test applications.
8. Instrument I/O Assistant
Instrument I/O Assistant is available from the Input and Output Express palettes in LabVIEW. With the assistant you can quickly and easily send commands to your instrument and view the responses real-time. To use the assistant, place the Instrument I/O Assistant Express VI on the block diagram (see Figure 4) and the interactive window automatically appears.
Figure 4. Instrument I/O Assistant Express VI
Once the interactive Instrument I/O Assistant dialog appears, select your instrument from the drop-down instrument list and then add steps to communicate with the instrument. The list of instruments is generated automatically by making a 'find resource' call and checking the Measurement & Automation Explorer, an I/O configuration utility, for any existing unique instrument names or aliases. You can search for instruments and assign unique names or aliases for your instruments through Measurement & Automation Explorer that will automatically show up in the Instrument I/O Assistant instrument pull-down menu.
Interactive control, the LabVIEW Instrument Wizard, and Instrument I/O Assistant are innovative tools that make your task of instrument control easier. The interactive control utility is a powerful tool for doing quick interactions and troubleshooting with your instruments. To automate interactive control, use the LabVIEW Instrument Wizard so you can quickly move from interactive to programming mode and begin building real test solutions with your instruments. Instrument I/O Assistant is a great tool to communicate with instruments when an instrument driver is not available. Furthermore the assistant can be used to assist instrument driver developers as a good replacement for other tools and in creating complex parsing routines.
Instrument Driver Network