47
Programming Example
Using Marker Delta Mode and Marker Minimum Search
/*Set the analyzer to the values given by the user*/
//viPrintf(viN9322C,"SENS:FREQ:STAR %lf
//MHZ;:SENS:FREQ:STOP %lf MHZ\n",dStartFreq,dStopFreq);
viPrintf(viN9322C,":SENS:FREQ:STAR %lf MHz\n",dStart-
Freq);
viPrintf(viN9322C,":SENS:FREQ:STOP %lf MHZ\n",dStopFreq);
/*Trigger a sweep, delay for completion*/
viPrintf(viN9322C,"INIT:IMM\n");
//delay(1);
/*Set the marker to the maximum peak*/
viPrintf(viN9322C,"CALC:MARK:MAX\n");
/*Set the analyzer to activate delta marker mode*/
viPrintf(viN9322C,"CALC:MARK:MODE DELT\n");
/*Trigger a sweep, delay for completion*
viPrintf(viN9322C,"INIT:IMM\n");
Sleep(1);
/*Set the marker to minimum amplitude Search mode*/
viPrintf(viN9322C,"CALC:MARK:PEAK:SEAR:MODE MIN\n");
/*Set the marker to minimum amplitude*/
viPrintf(viN9322C,"CALC:MARK:MAX\n");
/*Query and read the marker amplitude*/
viQueryf(viN9322C,"CALC:MARK:Y?\n","%lf",&dMarkerAmpli-
tude);
/*print the marker amplitude*/
printf("\n\n\tRESULT: Marker Amplitude Delta =%lf dB\n\
n",dMarkerAmplitude);
/*Close the session*/
viClose(viN9322C);
viClose(defaultRM);
}