HP ESA-E Series Programmer's Manual page 130

Esa spectrum analyzers
Table of Contents

Advertisement

Programming Examples
Determine if an Error has Occurred
{
/*Program Variables*/
ViStatus viStatus
long
lOpc= 0L;
int
iIntNum= 0;
long
lCount= 0L;
/* Open an HP-IB session at address 18*/
viStatus=viOpenDefaultRM(&defaultRM);
viStatus=viOpen(defaultRM,"GPIB0::18",VI_NULL,VI_NULL,&
viESA);
if(viStatus)
{
printf("Could not open a session to HP-IB device at
address 18!\n");
exit(0);
}
/*Clear the analyzer*/
viClear(viESA);
/*Reset the analyzer*/
viPrintf(viESA,"*RST\n");
/*Clear the status byte of the analyzer*/
viPrintf(viESA,"*CLS\n");
/*Display the program heading */
printf("\n\t\t Status register2 Program\n\n" );
/* Check for the analyzer model number and route the 50
MHz signal accordingly*/
Route50MHzSignal();
/*Put the analyzer in single sweep*/
viPrintf(viESA,"INIT:CONT 0 \n");
/*Set the service request mask to assert SRQ when either
a measurement is uncalibrated (i.e. "Meas Uncal" displayed on
screen) or an error message has occurred.*/
viPrintf(viESA,"STAT:QUES:ENAB 512\n");
viPrintf(viESA,"STAT:QUES:INT:ENAB 8\n");
viPrintf(viESA,"*ESE 35\n");
viPrintf(viESA,"*SRE 255\n");
3-66
= 0;
Chapter 3

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents