Agilent Technologies InfiniiVision 3000 Programmer's Manual page 1202

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

Advertisement

39
Programming Examples
1202
// Restore setup string.
myScope.SCPI.SYSTem.SETup.Command(strResultsArray);
Console.WriteLine("Setup bytes restored: {0}", nBytesWritten);
// Capture an acquisition using :DIGitize.
myScope.SCPI.DIGitize.Command("CHANnel1", null, null, null, null);
}
/*
* Analyze the captured waveform.
* --------------------------------------------------------------
*/
private static void Analyze()
{
string strResults, source1, source2;
double fResult;
// Make a couple of measurements.
// -----------------------------------------------------------
myScope.SCPI.MEASure.SOURce.Command("CHANnel1", null);
myScope.SCPI.MEASure.SOURce.Query(out source1, out source2);
Console.WriteLine("Measure source: {0}", source1);
myScope.SCPI.MEASure.FREQuency.Command("CHANnel1");
myScope.SCPI.MEASure.FREQuency.Query("CHANnel1", 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.
// -----------------------------------------------------------
myScope.SCPI.HARDcopy.INKSaver.Command(false);
// Get the screen data.
byte[] byteResultsArray;
myScope.SCPI.DISPlay.DATA.Query("PNG", "COLor",
out byteResultsArray);
int nLength;
// Number of bytes returned from instrument.
nLength = byteResultsArray.Length;
// Store the screen data to a file.
string strPath;
strPath = "c:\\scope\\data\\screen.png";
FileStream fStream = File.Open(strPath, FileMode.Create);
fStream.Write(byteResultsArray, 0, nLength);
fStream.Close();
Console.WriteLine("Screen image ({0} bytes) written to {1}",
nLength, strPath);
// Download waveform data.
// -----------------------------------------------------------
Agilent InfiniiVision 3000 X-Series Oscilloscopes Programmer's Guide
// Results array.

Advertisement

Table of Contents
loading

Table of Contents