2-22
Sample Programs
C Programming Examples
/*
*  Function name:  close_IO
*  Parameters:  none
*  Return value:  none
*  Description:  This routine closes device session.
*/ 
void close_IO ( )
{    
   ibonl ( scope,0 ); /* close device session */
} /* end close_IO ( ) */
Multi-Database Example
File: multidatabase.c
/*multidatabase.c*/
/*
* This example program demonstrates the use of the Multidatabase functionality of the
* Agilent 86100 DCA.  The program sets up an acquitision of 200 waveforms on two
* channels, first serially, then in parallel.  A mask test and simple
* measurements are made on each channel.  NOTE: the timeout value must
* be set to a higher value (~30s) so that there is enough time to acquire the 
* data.
*/
#include <stdio.h>//standard c++ io funcitons
#include <time.h>//time funcitons
//GPIB prototypes (from IO file)
void init_IO ( );
void write_IO ( char* );
int read_IO ( char*, unsigned long );
void close_IO ( );
//prototypes
void initialize();
int acquire_serial();
int acquire_parallel();
void main()
{
int serialTime, parallelTime; //declarations
init_IO(); //initial the interface and open GPIB communications
initialize(); //set up the instrument
serialTime = acquire_serial();//acquire the data in serial
parallelTime = acquire_parallel();//acquire the data in parallel
close_IO(); //close GPIB communications