Agilent Technologies N9340B Programmer's Manual page 48

Spectrum analyzer
Table of Contents

Advertisement

4
Programming Example
/*Open a USB session.*/
viStatus=viOpenDefaultRM(&defaultRM);
viStatus=viOpen(defaultRM,"USB0::2391::8472::0000000000::0::INSTR",V
I_NULL,VI_NULL,&viN9340B);
if(viStatus)
{
printf("Could not open a session to USB device\n");
exit(0);
}
/*Clear the instrument*/
viClear(viN9340B);
/*Reset the instrument*/
viPrintf(viN9340B,"*RST\n");
/*Set Y-Axis units to dBm*/
viPrintf(viN9340B,"UNIT:POW DBM\n");
/*Set the analyzer center frequency to 50MHZ*/
viPrintf(viN9340B,"SENS:FREQ:CENT 50e6\n");
/*Set the analyzer span to 50MHZ*/
viPrintf(viN9340B,"SENS:FREQ:SPAN 50e6\n");
/*Display the program heading */
printf("\n\t\t Marker Program \n\n" );
/* Check for the instrument model number and route the 50MHz signal
accordingly*/
Route50MHzSignal();
/*Set analyzer to single sweep mode*/
viPrintf(viN9340B,"INIT:CONT 0 \n ");
/*User enters the peak excursion value*/
printf("\t Enter PEAK EXCURSION in dB: ");
scanf( "%f",&fPeakExcursion);
42
N9340B Programmer's Guide

Advertisement

Table of Contents
loading

Table of Contents