Agilent Technologies InfiniiVision 5000 Series Programmer's Manual page 758

Hide thumbs Also See for InfiniiVision 5000 Series:
Table of Contents

Advertisement

12
Programming Examples
758
* communication with the computer interrupts data acquisition.
* Setting up the oscilloscope over the bus causes the data
* buffers to be cleared and internal hardware to be
* reconfigured.
* If a measurement is immediately requested there may not have
* been enough time for the data acquisition process to collect
* data and the results may not be accurate.
* 9.9E+37 may be returned over the bus in this situation.
*/
myScope.DoCommand(":DIGitize CHANnel1");
}
/*
* Analyze()
* --------------------------------------------------------------
* In this example we will do the following:
*
- Save the system setup to a file for restoration at a later
*
time.
*
- Save the oscilloscope display to a file which can be
*
printed.
*
- Make single channel measurements.
*/
private static void Analyze()
{
byte[] ResultsArray;
int nBytes;
// Number of bytes returned from instrument.
/* SAVE_SYSTEM_SETUP - The :SYSTem:SETup? query returns a
* program message that contains the current state of the
* instrument.
Its format is a definite-length binary block,
* for example,
*
#800002204<setup string><NL>
* where the setup string is 2204 bytes in length.
*/
Console.WriteLine("Saving oscilloscope setup to " +
"c:\\scope\\config\\setup.dat");
if (File.Exists("c:\\scope\\config\\setup.dat"))
File.Delete("c:\\scope\\config\\setup.dat");
// Query and read setup string.
ResultsArray = myScope.DoQueryIEEEBlock(":SYSTem:SETup?");
nBytes = ResultsArray.Length;
Console.WriteLine("Read oscilloscope setup ({0} bytes).",
nBytes);
// Write setup string to file.
File.WriteAllBytes("c:\\scope\\config\\setup.dat",
ResultsArray);
Console.WriteLine("Wrote setup string ({0} bytes) to file.",
nBytes);
/* RESTORE_SYSTEM_SETUP - Uploads a previously saved setup
* string to the oscilloscope.
*/
byte[] DataArray;
// Read setup string from file.
Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide
// Results array.
An error value of

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents