Agilent Technologies 86100-90086 Sprinkler User Manual


 
2-3
Sample Programs
Sample C Programs
Sample C Programs
Segments of the sample programs “init.c” and “gen_srq.c” are shown and described in this
chapter.
init.c - Initialization
/* init. c */
/* Command Order Example. This program demonstrates the order of commands suggested for operation of the analyzer via GPIB.
This program initializes the scope, acquires data, performs automatic measurements, and transfers and stores the data on the PC
as time/voltage pairs in a comma-separated file format useful for spreadsheet applications. It assumes a SICL INTERFACE exists
as 'hpib7' and an Agilent 86100 analyzer at address 7. It also requires the cal signal attached to Channel 1.
See the README file on the demo disk for development and linking information.
*/
# include <stdio.h> /* location of: printf ( ) */
# include <stdlib.h> /* location of: atof(), atoi ( ) */
# include "hpibdecl.h" /* prototypes, global declarations, constants */
void initialize ( ); /* initialize the scope */
void acquire_data ( ); /* digitize signal */
void auto_measurements ( ); /* perform built-in automatic measurements */
void transfer_data ( ); /* transfers waveform data from scope to PC */
void convert_data ( ); /* converts data to time/voltage values */
void store_csv ( ); /* stores time/voltage pairs to comma-separated
/* variable file format */
The include statements start the program. The file “hpibdecl.h” includes prototypes and dec-
larations that are necessary for the analyzer sample programs.
This segment of the sample program defines the functions, in order, that are used to initialize
the scope, digitize the data, perform measurements, transfer data from the scope to the PC,
convert the digitized data to time and voltage pairs, and store the converted data in comma-
separated variable file format.
See the following descriptions of the program segments.