872
Agilent InfiniiVision 7000A Series Oscilloscopes Programmer's Guide
12
Programming Examples
double fOffset = fYorigin;
double fSdiv
= fPoints * fXincrement / 10;
double fDelay = (fPoints / 2) * fXinc 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 < 1000; i = i + 50)
Console.WriteLine("Data point {0:d} = {1:f2} Volts at "
+ "{2:f10} Seconds", i,
((float)ResultsArray[i] - fYreference) * fYinc
fYorigin,
((float)i - fXreference) * fXinc 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 < 1000; i++)
writer.WriteLine("{0:E}, {1:f6}",
((float)i - fXreference) * fXinc fXorigin,
((float)ResultsArray[i] - fYreference) * fYinc
fYorigin);
writer.Close();
}
}
class VisaInstrument
{
private int m_nResourceManager;
private int m_nSession;
private string m_strVisaAddress;
// Constructor.
public VisaInstrument(string strVisaAddress)
{
// Save VISA address in member variable.
m_strVisaAddress = strVisaAddress;
// Open the default VISA resource manager.
OpenResourceManager();
// Open a VISA resource session.
OpenSession();
// Clear the interface.
int nViStatus;
nViStatus = visa32.viClear(m_nSession);
Summary of Contents for InfiniiVision 7000A Series
Page 1: ...Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide...
Page 34: ...34 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 1 What s New...
Page 44: ...44 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 2 Setting Up...
Page 58: ...58 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 3 Getting Started...
Page 750: ...750 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 8 Error Messages...
Page 922: ...922 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide Index...