![HP E4401B Скачать руководство пользователя страница 129](http://html.mh-extra.com/html/hp/e4401b/e4401b_programmers-manual_161548129.webp)
Chapter 3
3-65
Programming Examples
Determine if an Error has Occurred
}
/* When an interrupt occurs, determine which device
generated the interrupt (if an instrument other than the ESA
generates the interrupt, simply report “Instrument at HP-IB
Address xxx Has Generated an Interrupt").*/
printf ("\n SRQ Event Occured!\n");
printf ("\n ... Original Device Sesion = %1d\n",viESA);
/*Get the HP-IB address of the insrument, which has
interrupted*/
viQueryf(viESA,"SYST:COMM:GPIB:SELF:ADDR?\n","%t",
cBuf);
printf ("\n Instrument at HP-IB Address %s Has Generated
an Interrupt!\n",cBuf);
/*Get the status byte*/
/* If the ESA generated the interrupt, determine the
nature of the interrupt, either a measurement is uncalibrated
or an error message has occurred.*/
viQueryf(viESA, "STAT:QUES:INT:EVEN?\n", "%d",
&iStatusByte);
if ( (0x08 & iStatusByte))
printf("\n SRQ message:\t Measurement
uncalibrated\n");
/* If the ESA generated the interrupt, determine the
nature of the interrupt; did
the measurement complete or an
error message occur?*/
viQueryf(viESA, "*ESR?\n", "%d", &iStatusByte);
if ( (iStatusByte !=0) && (0x01 & iStatusByte))
printf("\n SRQ message:\t Measurement complete\n");
else if ( (iStatusByte !=0) && (0x02 | 0x10 | 0x20 &
iStatusByte ))
printf ("\n SRQ message:\t Error Message Occured\n");
/*Close the context before returning*/
viClose(ctx);
iSrqOccurred =1;
return VI_SUCCESS;
}
void main()
Содержание E4401B
Страница 6: ...vi ...
Страница 14: ...xiv Contents ...
Страница 64: ...2 34 Chapter2 HP ESA Status Registers Using the Analyzer Status Registers ...
Страница 65: ...3 1 3 Programming Examples ...
Страница 118: ...3 54 Chapter3 Programming Examples Entering Amplitude Correction Data Close the session viClose viESA viClose defaultRM ...
Страница 151: ...4 1 4 Programming Command Cross References ...
Страница 286: ...5 132 Chapter5 Language Reference UNIT Subsystem ...
Страница 287: ...6 1 6 HP 8590 HP ESA Spectrum Analyzers Programming Conversion Guide ...
Страница 292: ...1 HP 8590 HP ESA Spectrum Analyzers Conversion Guide ...
Страница 368: ...7 1 7 Error Messages ...
Страница 393: ...7 26 Chapter7 Error Messages 201 to 799 Device Specific Errors ...