Agilent Technologies InfiniiVision 5000 Series Programmer's Manual page 726

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

Advertisement

12
Programming Examples
726
+ "{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 < 1000; i++)
writer.WriteLine("{0:E}, {1:f6}",
((float)i - fXreference) * fXincrement + fXorigin,
((float)ResultsArray[i] - fYreference) * fYincrement +
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);
}
public void DoCommand(string strCommand)
{
// Send the command.
VisaSendCommandOrQuery(strCommand);
// Check for instrument errors (another command and result).
CheckForInstrumentErrors(strCommand);
}
public int DoCommandIEEEBlock(string strCommand,
byte[] DataArray)
{
Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents