43
Programming Example
Using C with Marker Peak Search and Peak Excursion
/*Set the peak excursion*/
viPrintf(viN9322C,"CALC:MARK:PEAK:EXC %1fDB \n",fPeakExcursion);
/*Set the peak thresold */
viPrintf(viN9322C,"CALC:MARK:PEAK:THR -90 \n");
/*Trigger a sweep and wait for completion*/
viPrintf(viN9322C,"INIT:IMM \n");
/*Set the marker to the maximum peak*/
viPrintf(viN9322C,"CALC:MARK:MAX \n");
/*Query and read the marker frequency*/
viQueryf(viN9322C,"CALC:MARK:X? \n","%lf",&dMarkerFreq);
printf("\n\t RESULT: Marker Frequency is: %lf MHZ \n\
n",dMarkerFreq/10e5);
/*Query and read the marker amplitude*/
viQueryf(viN9322C,"CALC:MARK:Y?\n","%lf",&dMarkerAmpl);
printf("\t RESULT: Marker Amplitude is: %lf dBm \n\n",dMarkerAmpl);
/*Close the session*/
viClose(viN9322C);
viClose(defaultRM);
}