
Programming Examples
12
Agilent InfiniiVision 7000A Series Oscilloscopes Programmer's Guide
869
// Read setup string from file.
DataArray = File.ReadAllBytes("c:\\scope\\config\\setup.dat");
Console.WriteLine("Read setup string ({0} bytes) from file.",
DataArray.Length);
// Restore setup string.
nBytesWritten = oscp.DoCommandIEEEBlock(":SYSTem:SETup",
DataArray);
Console.WriteLine("Restored setup string ({0} bytes).",
nBytesWritten);
/* IMAGE_TRANSFER - In this example, we query for the screen
* data with the ":DISPLAY:DATA?" query.
The .png format
* data is saved to a file in the local file system.
*/
Console.WriteLine("Transferring screen image to " +
"c:\\scope\\data\\screen.png");
if (File.Exists("c:\\scope\\data\\screen.png"))
File.Delete("c:\\scope\\data\\screen.png");
// Increase I/O timeout to fifteen seconds.
oscp.SetTimeoutSeconds(15);
// Get the screen data in PNG format.
nLength = oscp.DoQueryIEEEBlock(
":DISPlay:DATA? PNG, SCReen, COLor", out ResultsArray);
Console.WriteLine("Read screen image ({0} bytes).", nLength);
// Store the screen data in a file.
File.WriteAllBytes("c:\\scope\\data\\screen.png",
ResultsArray);
Console.WriteLine("Wrote screen image ({0} bytes) to file.",
nLength);
// Return I/O timeout to five seconds.
oscp.SetTimeoutSeconds(5);
/* MEASURE - The commands in the MEASURE subsystem are used to
* make measurements on displayed waveforms.
*/
// Set source to measure.
oscp.DoCommand(":MEASure:SOURce CHANnel1");
// Query for frequency.
double fResults;
fResults = oscp.DoQueryValue(":MEASure:FREQuency?");
Console.WriteLine("The frequency is: {0:F4} kHz",
fResults / 1000);
// Query for peak to peak voltage.
fResults = oscp.DoQueryValue(":MEASure:VPP?");
Console.WriteLine("The peak to peak voltage is: {0:F2} V",
fResults);
/* WAVEFORM_DATA - Get waveform data from oscilloscope. To
* obtain waveform data, you must specify the WAVEFORM
Содержание InfiniiVision 7000A Series
Страница 1: ...Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide...
Страница 34: ...34 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 1 What s New...
Страница 44: ...44 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 2 Setting Up...
Страница 58: ...58 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 3 Getting Started...
Страница 652: ...652 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 5 Commands by Subsystem...
Страница 750: ...750 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 8 Error Messages...
Страница 784: ...784 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 10 Synchronizing Acquisitions...
Страница 810: ...810 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 11 More About Oscilloscope Commands...
Страница 922: ...922 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide Index...