Finding SCPI Commands that are equivalent to .NET API commands and GUI functions
When programmatically controlling the VSA using SCPI, it's often necessary to first learn how to perform a task using the software's GUI. Other times, a program may exist for .NET API control that needs to be converted to SCPI. While most functions are SCPI-controllable, some SCPI commands do not directly map to a .NET API command or GUI function (e.g., a command may perform more than one GUI function, or it may take multiple commands to perform the equivalent GUI function).
Finding equivalent SCPI commands for GUI functions
The following steps will help you find a SCPI command that is equivalent to a GUI function:
- In the VSA user interface, select and click the checkbox to enable it. For each operation you perform, the corresponding .NET API command will be echoed to the Output window.
- In the Output window, Select and copy the property, or the part of the command string that comes after the last "." (do not copy any value that might follow the property). Example:
app.Measurements.SelectedItem.GetMeasurementExtension<CustomIQ.MeasurementExtension>().SearchLength= 0.01D; - Open the VSA SCPI reference and click the Search tab. In the Search field, paste the copied property and click . If an equivalent SCPI command exists, it should appear in the search results. The same property may exist for multiple measurement types, so you might need to scan through a short list of commands to find the right one.
Finding equivalent SCPI commands for .NET API commands
The steps for finding equivalent SCPI commands from the .NET API reference are similar to finding a SCPI command that is equivalent to a GUI function:
- Copy the .NET API property you wish to convert to SCPI (open the VSA .NET API reference and browse or search, use the GUI's Window > Output feature described above, or copy from an existing .NET API macro). Be sure to just copy the property, or the part of the command string that comes after the last "." (do not copy any value that might follow the property). Example:
app.Measurements.SelectedItem.GetMeasurementExtension<CustomIQ.MeasurementExtension>().SearchLength= 0.01D; - Open the VSA SCPI reference and click the Search tab. In the Search field, paste the copied property and click . If an equivalent SCPI command exists, it should appear in the search results. The same property may exist for multiple measurement types, so you might need to scan through a short list of commands to find the right one.
Using Search
It sometimes helps to narrow results by using boolean expressions in a search string. For instance, if your search result is exceedingly long, try using a boolean expression. For example:
| Search String | Number of Results |
| Preset | 79 |
| Preset AND CustomOFDM | 2 |
