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

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

Advertisement

Programming Examples
Status Register-Determine When a Measurement is Don e
viPrintf(viESA,"*RST\n") ;
/*Clear the status byte of the instrument* /
viPrintf(viESA,"*CLS\n") ;
/*Display the program heading * /
printf("\n\t Status Register - Determine When a Measurement is Done \n\n " ) ;
/*Put the analyzer in a single sweep* /
viPrintf(viESA,"INIT :CONT 0 \n") ;
/* Check for the instrument model number and route the 50MHz-signal accordingly* /
Route50MHzSignal() ;
/*Set the analyzer to 50MHz center frequency* /
viPrintf(viESA,"SENS :FREQ :CENT 50 MHz\n") ;
/*Set the analyzer resolution bandwidth to 300 Khz* /
viPrintf(viESA,"SENS :BAND :RES 300 KHz\n") ;
/*Set the analyzer to 10MHz 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 measuremen t
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, mySrgHdlr,ViAddr(10)) ;
viEnableEvent(viESA, VI EVENT SERVICE REQ,VI_HNDLR,VINULL) ;
/*Send an undefined command to the device* /
viPrintf(viESA, " IDN\n " ) ;
Chapter 3
3-61

Advertisement

Table of Contents
loading

Table of Contents