
904
Agilent InfiniiVision 2000 X-Series Oscilloscopes Programmer's Guide
38
Programming Examples
// 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;
// Results array.
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.
// -----------------------------------------------------------
Содержание InfiniiVision 2000 X-Series
Страница 1: ...s1 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide...
Страница 24: ...24 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide...
Страница 38: ...38 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 1 What s New...
Страница 48: ...48 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 2 Setting Up...
Страница 62: ...62 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 3 Getting Started...
Страница 120: ...120 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 4 Commands Quick Reference...
Страница 206: ...206 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 8 BUS n Commands...
Страница 242: ...242 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 11 DEMO Commands...
Страница 250: ...250 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 12 DIGital d Commands...
Страница 270: ...270 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 14 DVM Commands...
Страница 276: ...276 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 15 EXTernal Trigger Commands...
Страница 312: ...312 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 17 HARDcopy Commands...
Страница 332: ...332 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 19 MARKer Commands...
Страница 416: ...416 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 22 POD Commands...
Страница 424: ...424 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 23 RECall Commands...
Страница 446: ...446 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 24 SAVE Commands...
Страница 588: ...588 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 28 TIMebase Commands...
Страница 692: ...692 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 31 WGEN Commands...
Страница 758: ...758 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 34 Error Messages...
Страница 788: ...788 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 36 Synchronizing Acquisitions...
Страница 918: ...918 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 38 Programming Examples...