How to Capture GPIB Command Sequences for PNA-CXL Instrument Migration

Capture commands with the built in command logger:

You can run the CXL application to emulate the behavior of legacy equipment. Included with the CXL application is a built-in command logger. The command logger provides a convenient way to monitor live bus activity. Command logging can be useful for trouble-shooting problems.

For small problems, the built-in command logger can be helpful. However, there are limitations to how much information can be captured with the built-in command logger. The buffer size is limited to 27 commands and timing information is not captured. When it is necessary to capture additional timing informationin a larger buffer, other tools are available.

Capture commands on PCs installed with the NI or Agilent GPIB cards

If you are using a PC to control your instruments, it is most likely that you are using either a National Instruments GPIB card or an Agilent Technologies (or older Hewlett Packard) GPIB card. If you are not sure which you are using, go to the “Start/All Programs” menu and look for “National Instruments”. If you see an entry there, you are probably using the NI card. To make sure you can click “Start/All Programs/National Instruments/NI-488.2/Troubleshooting Utility. The following dialog should popup and you can check the software and hardware card(s) that are present.

If there is no “National Instruments” menu folder, then look for a folder named “Start/All Programs/Agilent IO Libraries Suite”. If you see this entry you probably have an Agilent GPIB card. To make sure, click ”Start/All Programs/Agilent IO Libraries Suite/Agilent Connection Expert”. A dialog similar to the one below should pop up. You can check to see if there are PIB interfaces connected and properly configured (green check).

Follow the directions below for the interface you are using. If you are using some other interface or a UNIX, LINIX computer contact us for other options.

Running NI Spy to Capture SCPI Commands

  1. Before running the user’s test software program, you will need to start the NI Spy program. From the “start” menu, select NI Spy


  1. In the Spy window, select Spy/Options … Under the General tab, set the call history large enough to capture all the commands you are sending (10,000 is usually OK most of the time unless the test runs for hours). Set the Buffer Limit per Parameter to “Large Buffer” and the Print/Export Settings to Extended.
  2. Under the Error Action Tab select “Continue capturing and ignore error”. Click OK to save these settings.
  3. Click the “Run” button (blue arrow) to start logging SCPI commands.

  4. Run the test software. NI Spy will slightly slow down the process , but will capture the Commands sent to the instruments :
  5. When finished capturing the SCPI commands, click the red stop button

  6. Click the menu: “ File/Save As … “ to save the file. Optionally you can “File/Export” the file.
  7. Email the saved file.Agilent has a program that can read the file, list all the unique SCPI commands, and allow us to replay your command sequence with lots of debugging aids.

Running Agilent IO Monitor to Capture SCPI Commands

  1. Before running the user’s test software program, you will need to start the IO Monitor program. From the “start” menu, select “Agilent IO Libraries Suite/Utilities/IO Monitor”
  2. In the IO Monitor window, select “Monitor/Options … “Under the Monitor tab, set the Maximum size of parameter buffer per I/O function call to 64K. Make sure SICL and Agilent Visa are selected. On The Display tab set the Maximum number of events to display large enough to capture all the commands you are sending (10,000 is usually OK most of the time unless the test runs for hours). Select “Stop collecting events” and Check the “Confirm Clear Display Action”.
    If you are using a newer version of Agilent IO Libraries, the previous tabbed dialog has changed (see below).
  1. Click the “Monitor I/O” button to start logging the SCPI commands. Click for the newer version.

  2. When finished capturing the SCPI commands, click the Stop Monitoring button or for the newer version.
  3. Click the menu: “ File/Save As … “ to save the file. Agilent has a program that can read the file and list all the unique SCPI commands.
    For the newer interface click “File/Save Messages As …” to save the captured file.

  4. Email the saved file. Agilent has a program that can read the file, list all the unique SCPI commands, and allow us to replay your command sequence with lots of debugging aids.