Agilent Technologies Model A.08.xx Water Dispenser User Manual


 
110 Chapter 3
Programming Examples
Using Marker Delta Mode and Marker Minimum Search
double dMarkerAmplitude = 0.0;
long lOpc =0L;
/* Open an GPIB session at address 18*/
viStatus=viOpenDefaultRM(&defaultRM);
viStatus=viOpen(defaultRM,"GPIB0::18",VI_NULL,VI_NULL,&viESA);
if(viStatus)
{
printf("Could not open a session to GPIB device at address 18!\n");
exit(0);
}
/*Clear the instrument*/
viClear(viESA);
/*Reset the instrument*/
viPrintf(viESA,"*RST\n");
/*Display the program heading */
printf("\n\t\t Marker Delta Program \n\n" );
/*Check for the instrument model number and route the 50MHz signal accordingly*/
Route50MHzSignal();
/*Set the analyzer to single sweep mode*/
viPrintf(viESA,"INIT:CONT 0\n");
/*Prompt the user for the start frequency*/
printf("\t Enter the Start frequency in MHz ");
/*The user enters the start frequency*/
scanf("%lf",&dStartFreq);
/*Prompt the user for the stop frequency*/
printf("\t Enter the Stop frequency in MHz ");
/*The user enters the stop frequency*/
scanf("%lf",&dStopFreq);
/*Set the analyzer to the values given by the user*/
viPrintf(viESA,"SENS:FREQ:STAR %lf MHZ \n;:SENS:FREQ:STOP %lf
MHZ\n",dStartFreq,dStopFreq);
/*Trigger a sweep, wait for completion*/
viPrintf(viESA,"INIT:IMM;*WAI\n");
/*Set the marker to the maximum peak*/