Technical data

Programming Example 4
N9320A Programmer’s Guide 41
/*Set the peak excursion*/
viPrintf(viN9320A,"CALC:MARK:PEAK:EXC %1fDB \n",fPeakExcursion);
/*Set the peak thresold */
viPrintf(viN9320A,"CALC:MARK:PEAK:THR -90 \n");
/*Trigger a sweep and wait for completion*/
viPrintf(viN9320A,"INIT:IMM \n");
/*Set the marker to the maximum peak*/
viPrintf(viN9320A,"CALC:MARK:MAX \n");
/*Query and read the marker frequency*/
viQueryf(viN9320A,"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(viN9320A,"CALC:MARK:Y?\n","%lf",&dMarkerAmpl);
printf("\t RESULT: Marker Amplitude is: %lf dBm \n\n",dMarkerAmpl);
/*Close the session*/
viClose(viN9320A);
viClose(defaultRM);
}