![HP E4401B Programmer'S Manual Download Page 131](http://html.mh-extra.com/html/hp/e4401b/e4401b_programmers-manual_161548131.webp)
Chapter 3
3-67
Programming Examples
Determine if an Error has Occurred
/*Configure the computer to respond to an
interrupt,install the handler and enable it */
viInstallHandler(viESA, VI_EVENT_SERVICE_REQ,
sSrqHdlr,ViAddr(10));
viEnableEvent(viESA,
VI_EVENT_SERVICE_REQ,VI_HNDLR,VI_NULL);
iSrqOccurred =0;
/*Set the analyzer to a 500 MHz center frequency*/
viPrintf(viESA,"SENS:FREQ:CENT 500 MHZ \n");
/*Set the analyzer to a 100 MHz span*/
viPrintf(viESA,"SENS:FREQ:SPAN 100 MHZ\n");
/*Set the analyzer to a auto resolution BW*/
viPrintf(viESA,"SENS:BAND:RES:AUTO 1\n");
/*Set the analyzer to a Auto Sweep Time*/
viPrintf(viESA,"SENS:SWE:TIME:AUTO 1\n");
/*Allow analyzer to sweep several times.*/
viPrintf(viESA,"INIT:CONT 1 \n");
/*Manually couple sweeptime to 5ms. reduce resolution BW
to 30 kHz. "Meas Uncal" should be displayed on the screen,
and an interrupt should be generated.*/
viPrintf(viESA,"SENS:SWE:TIME 5 ms \n");
viPrintf(viESA,"SENS:BAND:RES 30 KHZ \n");
/*Wait for SRQ*/
WaitForSRQ();
/* 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");
/*Send an undefined command to the device*/
viPrintf(viESA,"IDN\n");
/*Wait for SRQ*/
WaitForSRQ();
/*Disable and uninstall the interrupt handler*/
viDisableEvent (viESA, VI_EVENT_SERVICE_REQ,VI_HNDLR);
viUninstallHandler(viESA, VI_EVENT_SERVICE_REQ,
sSrqHdlr,ViAddr(10));
Summary of Contents for E4401B
Page 6: ...vi ...
Page 14: ...xiv Contents ...
Page 64: ...2 34 Chapter2 HP ESA Status Registers Using the Analyzer Status Registers ...
Page 65: ...3 1 3 Programming Examples ...
Page 151: ...4 1 4 Programming Command Cross References ...
Page 286: ...5 132 Chapter5 Language Reference UNIT Subsystem ...
Page 287: ...6 1 6 HP 8590 HP ESA Spectrum Analyzers Programming Conversion Guide ...
Page 292: ...1 HP 8590 HP ESA Spectrum Analyzers Conversion Guide ...
Page 368: ...7 1 7 Error Messages ...
Page 393: ...7 26 Chapter7 Error Messages 201 to 799 Device Specific Errors ...