# Debugging SCPI Programs

Migration Guide

- Migration Guide
- SCPI Differences
- SCPI Similarities
- SCPI Command Subsystem Comparison
- SCPI Programming Tools
- Setting Up the Oscilloscope in SCPI Programs
- Synchronizing Analysis with Acquired Data in SCPI Programs
- Querying Measurement Results
- Querying Waveform Data
- Waveform Load/Save Format Support
- Debugging SCPI Programs
- Example Programs for Common Oscilloscope Tasks, Old vs. New

As you migrate earlier Infiniium SCPI programs to Infiniium 2026, consider these debugging tips:

- Be sure to use the `:SYSTem:ERRor?` query's `DIAGnostic` parameter which returns the command that caused the error. This lets you check for errors less often, allowing programs to run faster, while still being able to identify the commands that cause errors.
- Put SCPI error queue checking into a function so that can be can placed at different points in your program. Moving the error checking point can be helpful when programs exits occur before the error queue is checked, possibly related to SCPI errors.
- Use Python `print` statements when debugging portions of your program. Consider using the `print` statement's "`flush=True`" parameter when you suspect text being sent to the standard output is not being output to the display in a timely manner.
- Use the Keysight IO Libraries Suite's IO Monitor utility. This will show you commands and responses as they occur on the SCPI interface.
- Use any other IO Libraries Suite, PyVISA, and Python debugging techniques you find helpful.