Technical data

Table Of Contents
1290 Agilent Infiniium 9000 Series Oscilloscopes Programmer's Reference
38 Sample Programs
// Get numeric values for later calculations.
double fXincrement;
myScope.SCPI.WAVeform.XINCrement.Query(out fXincrement);
double fXorigin;
myScope.SCPI.WAVeform.XORigin.Query(out fXorigin);
double fYincrement;
myScope.SCPI.WAVeform.YINCrement.Query(out fYincrement);
double fYorigin;
myScope.SCPI.WAVeform.YORigin.Query(out fYorigin);
// Get the waveform data.
myScope.SCPI.WAVeform.STReaming.Command(false);
short[] WordDataArray; // Results array.
myScope.SCPI.WAVeform.DATA.QueryWord(null, null, out WordDataArray
);
nLength = WordDataArray.Length;
Console.WriteLine("Number of data values: {0}", nLength);
// Set up output file:
strPath = "c:\\scope\\data\\waveform_data.csv";
if (File.Exists(strPath)) File.Delete(strPath);
// Open file for output.
StreamWriter writer = File.CreateText(strPath);
// Output waveform data in CSV format.
for(inti=0;i<nLength - 1; i++)
writer.WriteLine("{0:f9}, {1:f6}",
fXorigin + ((float)i * fXincrement),
(((float)WordDataArray[i])
* fYincrement) + fYorigin);
// Close output file.
writer.Close();
Console.WriteLine("Waveform format WORD data written to {0}",
strPath);
}
}
}
SCPI.NET Example in Visual Basic .NET
To compile and run this example in Microsoft Visual Studio 2008:
1 Install the Agilent Command Expert software and the command set for
the oscilloscope.
2 Open Visual Studio.
3 Create a new Visual Basic, Windows, Console Application project.
4 Cut- and- paste the code that follows into the Visual Basic .NET source
file.
5 Edit the program to use the VISA address of your oscilloscope.