Technical data

1052 Agilent Infiniium 90000 Series Oscilloscopes Programmer's Reference
35 Sample Programs
Console.WriteLine("Acquire mode: {0}", strResults);
// 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.SCPI.SYSTem.SETup.Command(DataArray);
Console.WriteLine("Setup bytes restored: {0}", nBytesWritten);
// Set the desired number of waveform points,
// and capture an acquisition.
myScope.SCPI.ACQuire.POINts.Command(32000);
myScope.SCPI.DIGitize.Command(null);
}
/*
* Analyze the captured waveform.
* --------------------------------------------------------------
*/
private static void Analyze()
{
string[] strResultsArray; // Results array.
string strResults;
double fResult;
// Make measurements.
// -----------------------------------------------------------
myScope.SCPI.MEASure.SOURce.Command("CHANnel1", null);
myScope.SCPI.MEASure.SOURce.Queryx(out strResultsArray);
Console.WriteLine("Measure source: {0}", strResultsArray[0]);
myScope.SCPI.MEASure.FREQuency.Command("CHANnel1", null);
myScope.SCPI.MEASure.FREQuency.QuerySendValidOff("CHANnel1",
null, out fResult);
Console.WriteLine("Frequency: {0:F4} kHz", fResult / 1000);
// Use direct command/query when commands not in command set.
myScope.Transport.Command.Invoke(":MEASure:VAMPlitude CHANnel1");
myScope.Transport.Query.Invoke(":MEASure:VAMPlitude? CHANnel1",
out strResults);
Console.WriteLine("Vertial amplitude: {0} V", strResults);
// Download the screen image.
// -----------------------------------------------------------
// Get the screen data.
byte[] byteResultsArray; // Results array.
myScope.SCPI.DISPlay.DATA.Query("PNG", null, null, null,
out byteResultsArray);
int nLength; // Number of bytes returned from instrument.
nLength = byteResultsArray.Length;