HP ESA-E Series Programmer's Manual page 124

Esa spectrum analyzers
Table of Contents

Advertisement

Programming Examples
Status Register–Determine When a Measurement is Done
/*Tune the analyzer resolution bandwidth to 300 Khz*/
viPrintf(viESA,"SENS:BAND:RES 300 kHz\n");
/*Set the analyzer to 10 MHz span*/
viPrintf(viESA,"SENS:FREQ:SPAN 10MHz\n");
/*Trigger a sweep*/
viPrintf(viESA,"INIT:IMM\n");
/*Make sure the previous command has been completed*/
viQueryf(viESA, "*OPC?\n", "%d", &lOpc);
if (!lOpc)
{
printf("Program Abort! error ocurred: last command was
not completed!\n");
exit(0);
}
/* Set the service request mask to assert SRQ when
either a measurement is completed or an error message has
occurred.*/
viPrintf(viESA,"*SRE 32\n");
viPrintf(viESA,"*ESE 35\n");
/* Configure the computer to respond to an interrupt*/
/*install the handler and enable it */
viInstallHandler(viESA, VI_EVENT_SERVICE_REQ,
mySrqHdlr,ViAddr(10));
viEnableEvent(viESA,
VI_EVENT_SERVICE_REQ,VI_HNDLR,VI_NULL);
/*Send an undefined command to the device*/
viPrintf(viESA,"IDN\n");
/*Wait for SRQ */
WaitForSRQ();
/*Averaging the successive measurements, Set video
averaging to 20 sweeps,Turn the avarage On,take a sweep*/
/* *OPC at the
tell the Instrument we need the 'Measurement Complete'
Information*/
viPrintf(viESA,":SENS:AVER:TYPE LPOW;:SENS:AVER:COUN
20;:SENS:AVER:STAT ON;*OPC;\n");
3-60
end of the above commands. This will
Chapter 3

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents