Agilent Technologies InfiniiVision 3000 Programmer's Manual page 1159

X-series
Hide thumbs Also See for InfiniiVision 3000:
Table of Contents

Advertisement

Agilent InfiniiVision 3000 X-Series Oscilloscopes Programmer's Guide
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);
Programming Examples
1159
39

Advertisement

Table of Contents
loading

Table of Contents