Agilent Technologies InfiniiVision 5000 Series Programmer's Manual page 728

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

Advertisement

12
Programming Examples
728
}
public double[] DoQueryValues(string strQuery)
{
// Send the query.
VisaSendCommandOrQuery(strQuery);
// Get the result string.
double[] fResultsArray;
fResultsArray = VisaGetResultValues();
// Check for instrument errors (another command and result).
CheckForInstrumentErrors(strQuery);
// Return string results.
return fResultsArray;
}
public int DoQueryIEEEBlock(string strQuery,
out byte[] ResultsArray)
{
// Send the query.
VisaSendCommandOrQuery(strQuery);
// Get the result string.
int length;
// Number of bytes returned from instrument.
length = VisaGetResultIEEEBlock(out ResultsArray);
// Check for instrument errors (another command and result).
CheckForInstrumentErrors(strQuery);
// Return string results.
return length;
}
private void CheckForInstrumentErrors(string strCommand)
{
// Check for instrument errors.
StringBuilder strInstrumentError = new StringBuilder(1000);
bool bFirstError = true;
do
{
VisaSendCommandOrQuery(":SYSTem:ERRor?");
strInstrumentError = VisaGetResultString();
if (strInstrumentError.ToString() != "+0,\"No error\"\n")
{
if (bFirstError)
{
Console.WriteLine("ERROR(s) for command '{0}': ",
strCommand);
bFirstError = false;
}
Console.Write(strInstrumentError);
}
} while (strInstrumentError.ToString() != "+0,\"No error\"\n");
}
Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents