Agilent Technologies InfiniiVision 3000 Programmer's Manual page 1110

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

Advertisement

39
Programming Examples
).
1110
myScope.DoCommand(":ACQuire:TYPE NORMal");
Console.WriteLine("Acquire type: {0}",
myScope.DoQueryString(":ACQuire:TYPE?"));
// Or, configure by loading a previously saved setup.
byte[] DataArray;
int nBytesWritten;
// Read setup string from file.
strPath = "c:\\scope\\config\\setup.stp";
DataArray = File.ReadAllBytes(strPath);
nBytesWritten = DataArray.Length;
// Restore setup string.
myScope.DoCommandIEEEBlock(":SYSTem:SETup", DataArray);
Console.WriteLine("Setup bytes restored: {0}", nBytesWritten);
// Capture an acquisition using :DIGitize.
myScope.DoCommand(":DIGitize CHANnel1");
}
/*
* Analyze the captured waveform.
* --------------------------------------------------------------
*/
private static void Analyze()
{
byte[] ResultsArray;
int nLength;
// Number of bytes returned from instrument.
string strPath;
// Make a couple of measurements.
// -----------------------------------------------------------
myScope.DoCommand(":MEASure:SOURce CHANnel1");
Console.WriteLine("Measure source: {0}",
myScope.DoQueryString(":MEASure:SOURce?"));
double fResult;
myScope.DoCommand(":MEASure:FREQuency");
fResult = myScope.DoQueryNumber(":MEASure:FREQuency?");
Console.WriteLine("Frequency: {0:F4} kHz", fResult / 1000);
myScope.DoCommand(":MEASure:VAMPlitude");
fResult = myScope.DoQueryNumber(":MEASure:VAMPlitude?");
Console.WriteLine("Vertial amplitude: {0:F2} V", fResult);
// Download the screen image.
// -----------------------------------------------------------
myScope.DoCommand(":HARDcopy:INKSaver OFF");
// Get the screen data.
ResultsArray =
myScope.DoQueryIEEEBlock(":DISPlay:DATA? PNG, COLor");
nLength = ResultsArray.Length;
// Store the screen data to a file.
Agilent InfiniiVision 3000 X-Series Oscilloscopes Programmer's Guide
// Results array.

Advertisement

Table of Contents
loading

Table of Contents