Agilent Technologies InfiniiVision 2000 X-Series Programmer's Manual page 854

Oscilloscopes
Hide thumbs Also See for InfiniiVision 2000 X-Series:
Table of Contents

Advertisement

38
Programming Examples
854
// Clear status and load the default setup.
myScope.DoCommand("*CLS");
myScope.DoCommand("*RST");
}
/*
* Capture the waveform.
* --------------------------------------------------------------
*/
private static void Capture()
{
// Use auto-scale to automatically configure oscilloscope.
myScope.DoCommand(":AUToscale");
// Set trigger mode (EDGE, PULSe, PATTern, etc., and input source.
myScope.DoCommand(":TRIGger:MODE EDGE");
Console.WriteLine("Trigger mode: {0}",
myScope.DoQueryString(":TRIGger:MODE?"));
// Set EDGE trigger parameters.
myScope.DoCommand(":TRIGger:EDGE:SOURCe CHANnel1");
Console.WriteLine("Trigger edge source: {0}",
myScope.DoQueryString(":TRIGger:EDGE:SOURce?"));
myScope.DoCommand(":TRIGger:EDGE:LEVel 1.5");
Console.WriteLine("Trigger edge level: {0}",
myScope.DoQueryString(":TRIGger:EDGE:LEVel?"));
myScope.DoCommand(":TRIGger:EDGE:SLOPe POSitive");
Console.WriteLine("Trigger edge slope: {0}",
myScope.DoQueryString(":TRIGger:EDGE:SLOPe?"));
// Save oscilloscope configuration.
byte[] ResultsArray;
int nLength;
// Number of bytes returned from instrument.
string strPath;
// Query and read setup string.
nLength = myScope.DoQueryIEEEBlock(":SYSTem:SETup?",
out ResultsArray);
// Write setup string to file.
strPath = "c:\\scope\\config\\setup.stp";
FileStream fStream = File.Open(strPath, FileMode.Create);
fStream.Write(ResultsArray, 0, nLength);
fStream.Close();
Console.WriteLine("Setup bytes saved: {0}", nLength);
// Change settings with individual commands:
// Set vertical scale and offset.
myScope.DoCommand(":CHANnel1:SCALe 0.05");
Console.WriteLine("Channel 1 vertical scale: {0}",
myScope.DoQueryString(":CHANnel1:SCALe?"));
myScope.DoCommand(":CHANnel1:OFFSet -1.5");
Console.WriteLine("Channel 1 vertical offset: {0}",
Agilent InfiniiVision 2000 X-Series Oscilloscopes Programmer's Guide
// Results array.

Advertisement

Table of Contents
loading

Table of Contents