Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Using NI-Spy to Log the NI-VXI/NI-VISA Function Calls Made by Your Application(s)

NI Spy is a valuable trouble shooting utility program that ships with the Win 32 versions of NI-488.2, NI-VXI and NI-VISA. With this tool, you can capture all function calls that your application makes into the following APIs: NI-VISA, NI-488, NI-VXI, IVI class drivers, NI-Scope, NI-DMM, NI-Switch, and more.

For each call, you can see its return code and verify the parameters. Failed calls are highlighted in red to make them easy to locate during your development. Detailed information includes contents of data buffers, time stamps, process IDs, and thread IDs. You can quickly debug multithreaded test applications. You can also save this information to a file or print out a hard copy.

NI-Spy can be launched from Start » Programs » NI-VXI or Start » Programs » VXIpnp. The main screen of NI-Spy is shown below.


Figure 1. Main Screen of NI-Spy


The NI-Spy toolbar contains shortcuts to the following commonly performed tasks:

Open: Opens a NI-Spy capture file.

Save: Saves the contents of the capture window to a file. Use the File Logging option under the Spy » Option menu to log a complete Spy session.

Print: Prints a capture to a printer. This printout contains details on each NI-Spy call.

Find: Finds a particular function call in the capture.

Capture: Begins a capture based on the settings in the Spy menu.

Stop Capture: Stops a capture.

Properties: Gives details about a particular call that was captured. The properties can also be accessed by double clicking on any function.

Clear: Clears the capture screen.

Help: Gets help on a particular function, tool, or menu option.


You can configure which kind of calls (NI-VXI, NI-VISA, NI-488 or other) you want to capture through the Spy menu. Note that you will not be able to capture the calls that NI-VISA makes into the lower level drivers such as NI-VXI or NI-488. Once you configure what type of calls you want to capture, you move on the next step: beginning a capture. To begin a capture, click the start capture button in the toolbar to begin a capture. When you are capturing, some buttons on the toolbar will become grayed out, signifying that those functions are not available during a capture. Now that NI-Spy is capturing, you may run your application in the background. NI-Spy will record all calls of the selected type. There are two primary colors used in NI-Spy: red and black. Black signifies success while red indicates an error. NI-SPY also uses the color blue when you have configured it to capture IVI class driver calls only. Blue is used to indicate an IVI interchangeability warning in this case.

Note: The Spy » Options menu selection allows you to customize NI-SPY. Set the Data Buffer Mode to Full Buffer to view the full contents of data buffers and set File Logging to Log to File to create a Spy capture file.


The color-coding makes it possible to quickly scan your capture for errors and warnings (in the case of IVI class drivers). Once you have functions in your capture, you can examine each one in detail using the Properties button (the same as a double-click). These properties will change depending on the exact function you are calling. However, all functions will have a General tab, an Input tab, and an Output tab. Some functions will have additional tabs.


Figure 3. The Basic Properties Dialog for Captured Functions



Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality?   Answered Your Question? 
  1 2 3 4 5
Please Provide Additional Feedback below
Please visit Request Support for product support inquiries. submit