
2-3
Sample Programs
C Programming Examples
* as 'gpib7' 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 */
/* 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 ( ) */
/*
* 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.
*/
Summary of Contents for 86100A
Page 18: ...1 14 Introduction Status Reporting Figure 1 4 Status Reporting Data Structures...
Page 19: ...1 15 Introduction Status Reporting Status Reporting Data Structures continued...
Page 94: ...2 40 Sample Programs BASIC Programming Examples...
Page 124: ...4 16 Root Level Commands VIEW...
Page 132: ...5 8 System Commands TIME...
Page 140: ...6 8 Acquire Commands SWAVeform RESet...
Page 152: ...7 12 Calibration Commands STATus...
Page 192: ...11 12 Display Commands SSAVer...
Page 202: ...12 10 Function Commands VERTical RANGe...
Page 203: ...13 AREA 13 2 DPRinter 13 2 FACTors 13 3 IMAGe 13 3 PRINters 13 4 Hardcopy Commands...
Page 316: ...21 12 TDR TDT Commands Rev A 05 00 and Below STIMulus...
Page 332: ......