Agilent Technologies InfiniiVision 5000 Series Programmer's Manual page 762

Hide thumbs Also See for InfiniiVision 5000 Series:
Table of Contents

Advertisement

12
Programming Examples
762
double fDelay = (fPoints / 2) * fXincrement + fXorigin;
// Print them out...
Console.WriteLine("Scope Settings for Channel 1:");
Console.WriteLine("Volts per Division = {0:f}", fVdiv);
Console.WriteLine("Offset = {0:f}", fOffset);
Console.WriteLine("Seconds per Division = {0:e}", fSdiv);
Console.WriteLine("Delay = {0:e}", fDelay);
// Print the waveform voltage at selected points:
for (int i = 0; i < nBytes; i = i + (nBytes / 20))
{
Console.WriteLine("Data point {0:d} = {1:f6} Volts at "
+ "{2:f10} Seconds", i,
((float)ResultsArray[i] - fYreference) * fYincrement +
fYorigin,
((float)i - fXreference) * fXincrement + fXorigin);
}
/* SAVE_WAVE_DATA - saves the waveform data to a CSV format
* file named "waveform.csv".
*/
if (File.Exists("c:\\scope\\data\\waveform.csv"))
File.Delete("c:\\scope\\data\\waveform.csv");
StreamWriter writer =
File.CreateText("c:\\scope\\data\\waveform.csv");
for (int i = 0; i < nBytes; i++)
{
writer.WriteLine("{0:E}, {1:f6}",
((float)i - fXreference) * fXincrement + fXorigin,
((float)ResultsArray[i] - fYreference) * fYincrement +
fYorigin);
}
writer.Close();
Console.WriteLine("Waveform data ({0} points) written to " +
"c:\\scope\\data\\waveform.csv.", nBytes);
}
}
class VisaComInstrument
{
private ResourceManagerClass m_ResourceManager;
private FormattedIO488Class m_IoObject;
private string m_strVisaAddress;
// Constructor.
public VisaComInstrument(string strVisaAddress)
{
// Save VISA address in member variable.
m_strVisaAddress = strVisaAddress;
// Open the default VISA COM IO object.
OpenIo();
// Clear the interface.
m_IoObject.IO.Clear();
Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents