Fetches the spectrum trace in IM measurement corresponding to the specified spectrumIndex.

Syntax

Namespace: NationalInstruments.RFmx.SpecAnMX

public int FetchSpectrum(string selectorString, double timeout, int spectrumIndex, ref Spectrum< float > spectrum)

Parameters

NameTypeDescription
selectorStringstring

Specifies a selector string comprising of the result name. If you do not specify the result name, the default result instance is used. Example:
""
""
"result::r1"
You can use the BuildResultString(string) method to build the selector string.

timeoutdouble

Specifies the timeout, in seconds, for fetching the specified measurement. Set this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the method waits until the measurement is complete.

spectrumIndexint

Specifies the index of the spectrum to fetch. When you set the SetMeasurementMethod(string, RFmxSpecAnMXIMMeasurementMethod) method to DynamicRange or Segmented, each of the tone and intermod has a separate spectrum. You can fetch these spectrums one at a time by using a spectrumIndex. The following list shows the spectrumIndex to use while fetching tones and intermods:
  • Lower tone spectrum: 0  

  • Upper tone spectrum: 1  

  • Lower intermod<n> spectrum: 2n+2 </n>

  • Upper intermod<n> spectrum: 2n+3 </n>


Hence, the segment index can range from 0 to 2*(Number of Intermods) + 1. When you set the SetMeasurementMethod(string, RFmxSpecAnMXIMMeasurementMethod) method to Normal, the IM measurement returns only one spectrum and a spectrumIndex equal to 0 is used to fetch the spectrum.

spectrumref Spectrum< float >

Upon return, contains the averaged power measured at each frequency bin. This value is expressed in dBm or dBm/Hz.

Returns

Returns the status code of this method. The status code either indicates success or describes a warning condition.