Summary tables can be queried programmatically through the 89600 VSA .NET API. This topic will introduce the methods used to get the data results and will provide some example code as well.
Summary tables display a list or table of metrics for the data being analyzed. Underlying the visual display of these metrics are the actual metric names and corresponding values and units (if applicable).
The list of metrics for a summary table can be queried using the methods and properties of the Application.Display.Traces[idx].MeasurementData class. You can access the MeasurementData object for a trace as shown in the following example:
// start a new instance of the 89600 VSA; not needed when running in a macro Application app = ApplicationFactory.Create(true, null, null, -1); MeasurementData traceBMeasData = app.Display.Traces[1].MeasurementData; double[] traceData = traceBMeasData.DoubleData;
Methods used to query summary tables
To get the values of the summary table data results, you will need to use the MeasurementData.Summary and Measurement.SummaryUnit methods. Each method has two overloads, one which takes the name of the data result as a string, and the other takes the index of the data result. The names and indexes come from the MeasurementData.SummaryNames collection.
Which method you use is determined by a couple of factors. The index values are not guaranteed to remain the same between versions of the 89600 VSA. In fact, some of the newer measurement types have summary tables whose data result indices change depending on settings such as uplink/downlink and number of input channels. So, unless you are iterating over all values in the summary table, your code will probably be more robust as well as more readable if you use the Summary and SummaryUnit methods that take the data result name as an string rather than using the corresponding index.
You can easily list the data result names using the ListSummaryTableResults macro described below.
Setting a trace to a summary table
To be able to query a particular summary table, you will first need to configure a trace window to contain the summary table. The following syntax configures the active trace to contain the Error Summary table.
-
app.Display.Traces.SelectedItem.DataName = "Demod Error Summary1";
You can query a list of DataNames for the current measurement type from the DataNames Property.
ListSummaryTableResults macro
The ListSummaryTableResults macro can be used to list the indexes, names, values, and units for all the data results in a summary table.
The ListSummaryTableResults macro is located in Examples folder in the 89600 VSA installation directory:
%PROGRAMFILES%\Keysight\89600 Software 20xx\89600 VSA Software\Examples\Macros
where 20xx is the 89600 VSA's version number.
To run the ListSummaryTableResults macro, follow these step:
-
Import the ListSummaryTableResults macro into the VSA.
See Importing and Exporting Macros for information about how to import the macros into the 89600 VSA.
-
Select a summary table to make it the active trace.
-
Click (Build and) Run in the Macros dialog.
The information from the summary table will be shown in the Output window.