# Common Queries for Statistical Measurements

## Description

The `:MEASure` subsystem's scalar measurement commands have common child queries that return statistical measurement results and also query the validity of those values. The common child commands and queries are available for all oscilloscope, eye, and jitter/noise measurements. Common statistical queries are children of each scalar measurement command and include the following:

:MEAN?
  Returns the Mean measurement. It is calculated over the number of waveform acquisitions returned by the `COUNt?` query.
:MINimum?
  Returns the Minimum measurement. It is calculated over the number of waveform acquisitions returned by the `COUNt?` query.
:MAXimum?
  Returns the Maximum measurement. It is calculated over the number of waveform acquisitions returned by the `COUNt?` query.
:SDEViation?
  Returns the standard deviation (Std Dev) measurement, which is only displayed in the result table for measurements. It is calculated over the number of waveform acquisitions returned by the `COUNt?` query.
:COUNt?
  Returns the number of measurements (Count) that have been made for the parent measurement. If the measurement is affected by the Measure All selection, the count can be much larger than the number of waveform acquisitions. Up to 64-bit integer values can be returned.
:LOCation?
  Returns the location (index) of the measurement in the displayed results table. This query is available for all waveform, eye, mask test, and histograms measurements. The active measurement list is indexed starting at 1 representing row 1 column 1 and continuing row-by-row until the last column in the last row. If a table cell is not used for data in a table, the index is not increased for that cell.
:REGion?
  Select a time span over which an oscilloscope measurement is made.
:SOURce?
  This command specifies the source waveform on which to perform the measurement.
:STATus?
  Queries the status of the measurement. This common child query has its own help topic.

  STATus? Query Response
  Response | Description
  --- | ---
  CORR | The measurement result is correct.
  INV | The measurement result is invalid. A question mark (?) is shown in the displayed results table instead of a measurement result.
  QUES | The measurement result is questionable. A question mark (?) is shown in the displayed results table next to the measurement result.

:STATus:REASon?
  Queries the explanation why the `STATus?` child query indicates an unsuccessful measurement. Refer to the table "Common Reasons for INV or QUES Status". If the `STATus?` child query indicates a successful measurement, `STATus:REASon?` returns a null string.

To return the current measurement result (listed as Current in the results tables) use the parent command. For example, use `:MEASure:HORizontal:RTIMe?`, which returns the value for the last waveform acquisition.

## Examples

The `:MEASure:HORizontal:RTIMe?` query has the following common child queries:

- `:MEASure:HORizontal:RTIMe:COUNt?`
- `:MEASure:HORizontal:RTIMe:MAXimum?`
- `:MEASure:HORizontal:RTIMe:MEAN?`
- `:MEASure:HORizontal:RTIMe:MINimum?`
- `:MEASure:HORizontal:RTIMe:SDEViation?`
- `:MEASure:HORizontal:RTIMe:STATus?`
- `:MEASure:HORizontal:RTIMe:STATus:REASon?`

You can also append the `:STATus?` and `:STATus:REASon?` child queries to the common statistical queries to determine the validity of those measurements. For example,

- `:MEASure:HORizontal:RTIMe:MAXimum:STATus?`
- `:MEASure:HORizontal:RTIMe:MAXimum:STATus:REASon?`

## With Smoothing Applied

If smoothing is turned on (`:ACQuire:SMODe`), the Current, Mean, Minimum, Maximum, and standard deviation (Std Dev) measurements are an average of all previous waveform or pattern acquisitions and are not available until the terminal acquisition Count has been reached (`:ACQuire:COUNt`). For example, in 16-count smoothing, the mean measurement is reported after the first 16 acquisitions have completed and the displayed Count value is then incremented from 0 to 1. Each subsequent acquisition increments the Count value.

## Results Tables

These results are also displayed in the Results table, but you may need to expand the table to its full width to be able to see them. Depending on the particular measurements, the results can be affected by the settings in the Configure Measurements dialog box:

- Top-Base Definition
- Threshold Definition
- Eye Boundary Definition

Before these values can be displayed in the results table, the table must be configured in full width mode.