EasyManua.ls Logo

Agilent Technologies InfiniiVision 5000 Series - Page 706

Agilent Technologies InfiniiVision 5000 Series
788 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
706 Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide
12 Programming Examples
* specified with the ":WAVEFORM:SOURCE" command.
*/
viPrintf(vi, ":WAVEFORM:DATA?\n"); /* Query waveform data. */
/* READ_WAVE_DATA - The wave data consists of two parts: the header,
* and the actual waveform data followed by an New Line (NL)
* character. The query data has the following format:
*
* <header><waveform data block><NL>
*
* Where:
*
* <header> = #800002048 (this is an example header)
*
* The "#8" may be stripped off of the header and the remaining
* numbers are the size, in bytes, of the waveform data block.
* The size can vary depending on the number of points acquired
* for the waveform which can be set using the ":WAVEFORM:POINTS"
* command. You may then read that number of bytes from the
* oscilloscope; then, read the following NL character to
* terminate the query.
*/
waveform_size = WAVE_DATA_SIZE;
/* Read waveform data. */
viScanf(vi, "%#b\n", &waveform_size, waveform_data);
if ( waveform_size == WAVE_DATA_SIZE )
{
printf("Waveform data buffer full: ");
printf("May not have received all points.\n");
}
else
{
printf("Reading waveform data... size = %d\n", waveform_size);
}
}
/*
* save_waveform
* ------------------------------------------------------------------
* This function saves the waveform data from the get_waveform
* function to disk. The data is saved to a file called "wave.dat".
*/
void save_waveform(void)
{
FILE *fp;
fp = fopen("c:\\scope\\data\\wave.dat", "wb");
/* Write preamble. */
fwrite(preamble, sizeof(preamble[0]), 10, fp);
/* Write actually waveform data. */
fwrite(waveform_data, sizeof(waveform_data[0]), (int)preamble[2],
fp);
fclose(fp);
}
/*

Table of Contents

Other manuals for Agilent Technologies InfiniiVision 5000 Series

Related product manuals