Fact 4. How to Perform a Measurement

Avoid subtle programming errors! To ensure that the correct measurement is installed or queried, always explicitly identify a measurement when:

  • Installing a measurement
  • Querying a measured value
  • Querying the measurement status
  • Querying some other detail such as measurement units

To identify a measurement, specify the measurement's source waveform (:SOURce child command). With some measurements, you may also need to specify other identifying values, which are usually indicated in the measurement's topic. Generally, when selecting a measurement using FlexDCA's GUI, if a dialog appears prompting you to select values, you should explicitly set these values when remotely identifying the measurement. For example, the following picture is FlexDCA's dialog for Eye Mode's TJ measurement. To install and return this measurement, you would send these commands:

flex.write(':MEAS:EYE:TJ:SOURce CHAN1B')  # channel 1B
flex.write(':MEAS:EYE:TJ:TJBer 1.0E-12')
flex.write(':MEAS:EYE:TJ:RJSTabilize ON')
flex.write(':MEAS:EYE:TJ:RJSValue:EYE0 1E-15')
flex.write(':MEAS:EYE:TJ')
flex.query(':MEAS:EYE:TJ?')  # channel 1B
flex.write(':MEAS:EYE:DJ:SOURce CHAN2A')
flex.query(':MEAS:EYE:DJ?')  # channel 2A
flex.query(':MEAS:EYE:TJ?')  # channel 2A

Lines 1, 2, 3 and 4 send identity commands for the TJ measurement: :SOURce, :TJBer, :RJSTabilize, and :RJSValue. These commands identify the measurement and are global settings that are applied to any measurement that requires the settings. In fact, the :SOURce setting is applied to most measurements.

 

Line 6 returns the first TJ? query which is the measured on channel 1B.

Line 8 returns the DJ? query which is the measured on channel 2A.

Line 9 returns the second TJ? query. But, because we did not send the :SOURce command to explicitly specify the channel, the measurement is returned on channel 2A. Channel 2A was set with the :DJ:SOURce command which writes to the global setting used for TJ.

Because identity commands are global in nature, it's always best to explicitly set the source waveform, and any other measurement identity, just before you install or query the measurement. It there are any SCPI commands between these actions, there is always a chance that you will be returning the measurement from an incorrect source waveform.

The second discovery in the above programming example is that the results for the second TJ measurement (line 9) are not listed in the FlexDCA application's GUI. Sending only the query form (:TJ?) of the measurement command (:TJ) results in a valid measurement, but does not install the measurement. Although this works, it is best to always install the measurement before querying its value. In addition, if the measurement is not installed, you can't query the statistical common child measurements :MEAN?, :MINimum?, :MAXimum?, :SDEViation?, or :COUNt?.