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

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
/*
*OPC
* /
/* - Wait for the SRQ
* /
/* - When an interrupt occurs, poll all instruments
* /
/* - Report the nature of the interrupt on the ESA analyzer * /
/* - Clear the status register enable
*/
/*
*SRE 0
*/
/* - Clear the status byte of the ESA
*/
/*
*CLS
*/
/* - Close the session
*/
/************************************************************ /
#include <stdio .h>
#include <stdlib .h >
#include <math .h >
#include <conio .h>
#include <ctype .h>
#include <string .h>
#include <windows .h >
#include "visa .h "
#define hpESA IDN_E4401B "Hewlett-Packard, E4401B "
#define hpESA IDN E4411B "Hewlett-Packard, E4411B "
#define YIELD Sleep(10 )
ViSession defaultRM, viESA ;
ViStatus errStatus ;
ViChar
cIdBuff[256] = {0} ;
char
cEnter =0 ;
int
iResult =0 ;
int
iSrgOccurred=0 ;
char
cBuf[3]={O} ;
/*Wait until SRQ is generated and for the handler to be called . Print
something while waiting . When interrupt occurs it will be handled b y
interrupt handler* /
void WaitForSRQ( )
{
long lCount = OL ;
iSrqOccurred
=0 ;
printf ("\t\nWaiting for an SRQ to be generated . . .") ;
for (lCount =0 ;(lCount<l0) && (iSrqOccurred
=0) ; lCount++ )
{
long lCount2 =0 ;
printf(" .") ;
3-58
Chapter 3

Advertisement

Table of Contents
loading

Table of Contents