Agilent Technologies 86100-90086 Sprinkler User Manual


 
2-34
Sample Programs
Listings of the Sample Programs
int read_IO (void *buffer,unsigned long length)
{
ibrd (scope, buffer, ( long ) length );
return ( ibcntl );
} /* end read_IO ( ) */
/*
* Function name: check_SRQ
* Parameters: none
* Return value: integer indicating if bus SRQ line was asserted
* Description: This routine checks for the status of SRQ on the bus and
* returns a value to indicate the status.
*/
int check_SRQ ( )
{
int srq_asserted;
short control_lines = 0;
iblines ( bus, &control_lines);
if ( control_lines & BusSRQ )
srq_asserted = TRUE;
else
srq_asserted = FALSE;
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 */
ibrsp ( scope, &statusbyte );
return ( statusbyte );
} /* end read_status ( ) */
/*
* Function name: close_IO
* Parameters: none
* Return value: none