Agilent Technologies ESA-E Series Programmer's Manual page 73

Esa spectrum analyzers
Hide thumbs Also See for ESA-E Series:
Table of Contents

Advertisement

Programming Examples
Using Marker Delta Mode and Marker Minimum Search
long
lOpc =0L;
/* Open an HP-IB 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 HP-IB 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*/
viPrintf(viESA,"INIT:IMM\n");
/*Check for operation complete*/
viQueryf(viESA, "*OPC?\n", "%d", &lOpc);
3-18
Chapter 3

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents