2-33
Sample Programs
Listings of the Sample Programs
ibclr ( scope ); /* clear the device( scope ) */
if ( ibsta & ERR)
{
hpiberr ("ibclr error" );
}
} /* end init_IO */
/*
* Function name: write_IO
* Parameters: void *buffer which is a pointer to the character string to be output
* Return value: none
* Description: This routine outputs strings to the scope device session.
*/
void write_IO ( void *buffer )
{
long length;
length = strlen ( buffer );
ibwrt ( scope, buffer, (long) length );
if ( ibsta & ERR )
{
hpiberr ( "ibwrt error" );
}
} /* end write_IO() */
/*
* Function name: write_lrnstr
* Parameters: void *buffer which is a pointer to the character string to
* be output; length which is the length of the string to be output
* Return value: none
* Description: This routine outputs a learnstring to the scope device session.
*/
void write_lrnstr ( void *buffer, long length )
{
ibwrt ( scope, buffer, (long) length );
if ( ibsta & ERR )
{
hpiberr ( "ibwrt error" );
}
} /* end write_lrnstr ( ) */
/*
* Function name: read_IO
* Parameters: char *buffer which is a pointer to the character string to be input;
* unsigned long length which indicates the max length of the string to be input
* Return value: integer which indicates the actual number of bytes read
* Description: This routine inputs strings from the scope device session.
*/