Agilent Technologies 86100-90086 Sprinkler User Manual


 
2-29
Sample Programs
Listings of the Sample Programs
}/* end get_learnstring */
sicl_IO.c Sample Program
/* sicl_IO.c */
#include <stdio.h> /* location of: printf ( ) */
#include <string.h> /* location of: strlen ( ) */
#include "hpibdecl.h"
/* This file contains IO and initialization routines for the SICL libraries. */
/*
* Function name: init_IO
* Parameters: none
* Return value: none
* Description: This routine initializes the SICL environment. It sets up
* error handling, opens both an interface and device session, sets timeout
* values, clears the interface by pulsing IFC, and clears the instrument
* by performing a Selected Device Clear.
*/
void init_IO ( )
{
ionerror (I_ERROR_EXIT); /* set-up interface error handling */
/* open interface session for verifying SRQ line */
bus = iopen ( INTERFACE );
if ( bus == 0 )
printf ("Bus session invalid\n");
itimeout ( bus, 20000 ); /* set bus timeout to 20 sec */
iclear ( bus ); /* clear the interface - pulse IFC */
scope = iopen ( DEVICE_ADDR ); /* open the scope device session */
if ( scope == 0)
printf ( "Scope session invalid\n");
itimeout ( scope, 20000 ); /* set device timeout to 20 sec */
iclear ( scope ); /* perform Selected Device Clear on scope */
} /* end init_IO */
/*
* Function name: write_IO
* Parameters: char *buffer which is a pointer to the character string to be
* output; unsigned long length which is the length of the string to be output
* Return value: none
* Description: This routine outputs strings to the scope device session
* using the unformatted I/O SICL commands.
*/