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

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

Advertisement

Programming Example s
Determine if an Error has Occurred
/*Set the input port to 50MHz amplitude reference* /
void Route50MHzSignal( )
{
viQueryf(viESA, "*IDN?\n " , "%t", &cldBuff) ;
iResult = (strncmp( cldBuff, hpESA IDN_E4401B, strlen(hpESA IDN E4401B)) & &
strncmp( cldBuff, hpESA IDN E4411B, strlen(hpESA IDN E4411B))) ;
if( iResult = 0 )
{
/*Set the input port to the 50MHz amplitude reference for the models* /
/*E4411B and E4401B* /
viPrintf(viESA,"CAL :SOUR :STAT ON \n") ;
/* For the analyzers having frequency limits >= 3GHz, prompt the user* /
/* to connect the amplitude reference output to the input* /
printf ("Connect AMPTD REF OUT to the INPUT \n") ;
printf ("
Press Return to continue \n") ;
scanf( "%c",&cEnter) ;
/*Externally route the 50MHz Signal* /
viPrintf(viESA,"CAL :SOUR :STAT ON \n") ;
}
}
/*Interrupt handler,trigger event handler * /
ViStatus _VI_FUNCH sSrgHdlr(ViSession viESA, ViEventType eventType, ViEven t
ctx,ViAddr userHdlr )
{
ViUInt16 iStatusByte=0 ;
long lCond = OL ;
/* Make sure it is an SRQ event, ignore if stray event* /
if (eventType l=VI_EVENT SERVICE REQ )
{
printf ("\n Stray event type0x%lx\n",eventType) ;
/*Return successfully* /
return VI SUCCESS ;
}
/* When an interrupt occurs, determine which device generated the interrup t
(if an instrument other than the ESA generates the interrupt, simply repor t
"Instrument at HP-IB Address xxx Has Generated an Interrupt") .* /
printf ("\n SRQ Event Occurredl\n") ;
printf ("\n . . . Original Device Session = %ld\n",viESA) ;

Advertisement

Table of Contents
loading

Table of Contents