Agilent Technologies 86100-90086 Sprinkler User Manual


 
2-4
Sample Programs
Sample C Programs
init.c - Global Definitions and Main Program
/* GLOBALS */
int count;
double xorg,xref,xinc; /* values necessary for conversion of data */
double yorg,yref,yinc;
int Acquired_length;
char data[MAX_LENGTH]; /* data buffer */
double time_value[MAX_LENGTH]; /* time value of data */
double volts[MAX_LENGTH]; /* voltage value of data */
void main( void )
{
/* initialize interface and device sessions */
/* note: routine found in sicl_IO.c or natl_IO.c */
init_IO ( );
initialize ( ); /* initialize the scope and interface and set up SRQ */
acquire_data ( ); /* capture the data */
auto_measurements ( ); /* perform automated measurements on acquired data */
transfer_data ( ); /* transfer waveform data to the PC from scope */
convert_data ( ); /* convert data to time/voltage pairs */
store_csv ( ); /* store the time/voltage pairs as csv file */
close_IO ( ); /* close interface and device sessions */
/* note: routine found in sicl_IO.c or natl_IO.c */
} /* end main ( ) */
The init_IO routine initializes the analyzer and interface so that the scope can capture data
and perform measurements on the data. At the start of the program, global symbols are
defined which will be used to store and convert the digitized data to time and voltage values.
init.c - Initializing the Analyzer
/*
* Function name: initialize
* Parameters: none
* Return value: none
* Description: This routine initializes the analyzer for proper
* acquisition of data. The instrument is reset to a known state and the
* interface is cleared. System headers are turned off to allow faster
* throughput and immediate access to the data values requested by queries.
* The analyzer time base, channel, and trigger subsystems are then
* configured. Finally, the acquisition subsystem is initialized.
*/
void initialize ( )
{
write_IO ("*RST"); /* reset scope - initialize to known state */