Agilent Technologies InfiniiVision 3000 Programmer's Manual page 1182

X-series
Hide thumbs Also See for InfiniiVision 3000:
Table of Contents

Advertisement

39
Programming Examples
}
/* Analyze the captured waveform.
* --------------------------------------------------------------- */
void analyze (void)
{
1182
fclose (fp);
printf("Read setup string (%d bytes) from file ", num_bytes);
printf("c:\\scope\\config\\setup.stp.\n");
/* Restore setup string. */
num_bytes = do_command_ieeeblock(":SYSTem:SETup", num_bytes);
printf("Restored setup string (%d bytes).\n", num_bytes);
/* Capture an acquisition using :DIGitize.
* ------------------------------------------------------------- */
do_command(":DIGitize CHANnel1");
double wav_format;
double acq_type;
double wav_points;
double avg_count;
double x_increment;
double x_origin;
double x_reference;
double y_increment;
double y_origin;
double y_reference;
FILE *fp;
int num_bytes;
/* Number of bytes returned from instrument. */
int i;
/* Make a couple of measurements.
* ------------------------------------------------------------- */
do_command(":MEASure:SOURce CHANnel1");
do_query_string(":MEASure:SOURce?");
printf("Measure source: %s\n", str_result);
do_command(":MEASure:FREQuency");
do_query_number(":MEASure:FREQuency?");
printf("Frequency: %.4f kHz\n", num_result / 1000);
do_command(":MEASure:VAMPlitude");
do_query_number(":MEASure:VAMPlitude?");
printf("Vertical amplitude: %.2f V\n", num_result);
/* Download the screen image.
* ------------------------------------------------------------- */
do_command(":HARDcopy:INKSaver OFF");
/* Read screen image. */
num_bytes = do_query_ieeeblock(":DISPlay:DATA? PNG, COLor");
printf("Screen image bytes: %d\n", num_bytes);
/* Write screen image bytes to file. */
fp = fopen ("c:\\scope\\data\\screen.png", "wb");
num_bytes = fwrite(ieeeblock_data, sizeof(unsigned char), num_bytes,
Agilent InfiniiVision 3000 X-Series Oscilloscopes Programmer's Guide

Advertisement

Table of Contents
loading

Table of Contents