Agilent Technologies 86100-90086 Sprinkler User Manual


 
2-31
Sample Programs
Listings of the Sample Programs
int check_SRQ( )
{
int srq_asserted;
/* check for SRQ line status */
ihpibbusstatus(bus, I_GPIB_BUS_SRQ, &srq_asserted);
return ( srq_asserted );
} /* end check_SRQ ( ) */
/*
* Function name: read_status
* Parameters: none
* Return value: unsigned char indicating the value of status byte
* Description: This routine reads the scope status byte and returns the status.
*/
unsigned char read_status ( )
{
unsigned char statusbyte;
/* Always read the status byte from instrument */
/* NOTE: ireadstb uses serial poll to read status byte - this should clear bit 6 to allow another SRQ. */
ireadstb ( scope, &statusbyte );
return ( statusbyte );
} /* end read_status ( ) */
/*
* Function name: close_IO
* Parameters: none
* Return value: none
* Description: This routine closes device and interface sessions for the
* SICL environment and calls the routine _siclcleanup which de-allocates
* resources used by the SICL environment.
*/
void close_IO ( )
{
iclose ( scope ); /* close device session */
iclose ( bus ); /* close interface session */
_siclcleanup ( ); /* required for 16-bit applications */
} /* end close_SICL ( ) */