
Programming Examples
38
Agilent InfiniiVision 2000 X-Series Oscilloscopes Programmer's Guide
861
private double[] VisaGetResultNumbers()
{
double[] fResultsArray;
fResultsArray = new double[10];
// Read return value string from the device.
int nViStatus;
nViStatus = visa32.viScanf(m_nSession, "%,10lf\n",
fResultsArray);
CheckVisaStatus(nViStatus);
return fResultsArray;
}
private int VisaGetResultIEEEBlock(out byte[] ResultsArray)
{
// Results array, big enough to hold a PNG.
ResultsArray = new byte[300000];
int length;
// Number of bytes returned from instrument.
// Set the default number of bytes that will be contained in
// the ResultsArray to 300,000 (300kB).
length = 300000;
// Read return value string from the device.
int nViStatus;
nViStatus = visa32.viScanf(m_nSession, "%#b", ref length,
ResultsArray);
CheckVisaStatus(nViStatus);
// Write and read buffers need to be flushed after IEEE block?
nViStatus = visa32.viFlush(m_nSession, visa32.VI_WRITE_BUF);
CheckVisaStatus(nViStatus);
nViStatus = visa32.viFlush(m_nSession, visa32.VI_READ_BUF);
CheckVisaStatus(nViStatus);
return length;
}
private void CheckInstrumentErrors(string strCommand)
{
// Check for instrument errors.
StringBuilder strInstrumentError = new StringBuilder(1000);
bool bFirstError = true;
do
// While not "0,No error"
{
VisaSendCommandOrQuery(":SYSTem:ERRor?");
strInstrumentError = VisaGetResultString();
if (!strInstrumentError.ToString().StartsWith("+0,"))
{
if (bFirstError)
{
Console.WriteLine("ERROR(s) for command '{0}': ",
strCommand);
Summary of Contents for InfiniiVision 2000 X-Series
Page 1: ...s1 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide...
Page 24: ...24 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide...
Page 38: ...38 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 1 What s New...
Page 48: ...48 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 2 Setting Up...
Page 62: ...62 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 3 Getting Started...
Page 206: ...206 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 8 BUS n Commands...
Page 242: ...242 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 11 DEMO Commands...
Page 250: ...250 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 12 DIGital d Commands...
Page 270: ...270 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 14 DVM Commands...
Page 312: ...312 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 17 HARDcopy Commands...
Page 332: ...332 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 19 MARKer Commands...
Page 416: ...416 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 22 POD Commands...
Page 424: ...424 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 23 RECall Commands...
Page 446: ...446 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 24 SAVE Commands...
Page 588: ...588 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 28 TIMebase Commands...
Page 692: ...692 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 31 WGEN Commands...
Page 758: ...758 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 34 Error Messages...