Programming Examples
41
Agilent InfiniiVision 4000 X-Series Oscilloscopes Programmer's Guide
1257
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_ ((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");
}
/* Send a command to the instrument.
* --------------------------------------------------------------- */
void do_command(command)
char *command;
{
char message[80];
strcpy(message, command);
strcat(message, "\n");
err = viPrintf(vi, message);
if (err != VI_SUCCESS) error_handler();
check_instrument_errors();
}
/* Command with IEEE definite-length block.
* --------------------------------------------------------------- */
int do_command_ieeeblock(command, num_bytes)
char *command;
int num_bytes;
Summary of Contents for InfiniiVision 4000 X-Series
Page 1: ...s1 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide ...
Page 32: ...32 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide ...
Page 52: ...52 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 2 Setting Up ...
Page 66: ...66 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 3 Getting Started ...
Page 242: ...242 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 7 ACQuire Commands ...
Page 252: ...252 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 8 BUS n Commands ...
Page 300: ...300 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 12 DEMO Commands ...
Page 330: ...330 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 15 DVM Commands ...
Page 386: ...386 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 18 HARDcopy Commands ...
Page 484: ...484 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 21 MEASure Commands ...
Page 1098: ...1098 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 34 WGEN w Commands ...
Page 1174: ...1174 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 37 Error Messages ...
Page 1352: ...1352 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide Index ...