Agilent Technologies InfiniiVision 3000 Programmer's Manual page 1137

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

Advertisement

}
/* Send a command to the instrument.
* --------------------------------------------------------------- */
void do_command(command)
char *command;
{
}
/* Command with IEEE definite-length block.
* --------------------------------------------------------------- */
int do_command_ieeeblock(command, num_bytes)
char *command;
int num_bytes;
Agilent InfiniiVision 3000 X-Series Oscilloscopes Programmer's Guide
printf("Waveform X origin: %e\n", x_origin);
x_reference = dbl_results[6];
printf("Waveform X reference: %e\n", x_reference);
y_increment = dbl_results[7];
printf("Waveform Y increment: %e\n", y_increment);
y_origin = dbl_results[8];
printf("Waveform Y origin: %e\n", y_origin);
y_reference = dbl_results[9];
printf("Waveform Y reference: %e\n", y_reference);
/* Read waveform data. */
num_bytes = do_query_ieeeblock(":WAVeform:DATA?");
printf("Number of data values: %d\n", num_bytes);
/* Open file for output. */
fp = fopen("c:\\scope\\data\\waveform_data.csv", "wb");
/* Output waveform data in CSV format. */
for (i = 0; i < num_bytes - 1; i++)
{
/* Write time value, voltage value. */
fprintf(fp, "%9f, %6f\n",
x_origin + ((float)i * x_increment),
(((float)ieeeblock_data[i] - y_reference) * y_increment)
+ y_origin);
}
/* Close output file. */
fclose(fp);
printf("Waveform format BYTE data written to ");
printf("c:\\scope\\data\\waveform_data.csv.\n");
char message[80];
strcpy(message, command);
strcat(message, "\n");
err = viPrintf(vi, message);
if (err != VI_SUCCESS) error_handler();
check_instrument_errors();
Programming Examples
1137
39

Advertisement

Table of Contents
loading

Table of Contents