Agilent Technologies InfiniiVision 5000 Series Programmer's Manual page 764

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

Advertisement

12
Programming Examples
764
// Return result numbers.
return fResultsArray;
}
public byte[] DoQueryIEEEBlock(string strQuery)
{
// Send the query.
m_IoObject.WriteString(strQuery, true);
// Get the results array.
byte[] ResultsArray;
ResultsArray = (byte[])m_IoObject.ReadIEEEBlock(
IEEEBinaryType.BinaryType_UI1, false, true);
// Check for instrument errors.
CheckForInstrumentErrors(strQuery);
// Return results array.
return ResultsArray;
}
public void DoCommandIEEEBlock(string strCommand,
byte[] DataArray)
{
// Send the command.
m_IoObject.WriteIEEEBlock(strCommand, DataArray, true);
// Check for instrument errors.
CheckForInstrumentErrors(strCommand);
}
private void CheckForInstrumentErrors(string strCommand)
{
string strInstrumentError;
bool bFirstError = true;
// Repeat until all errors are displayed.
do
{
// Send the ":SYSTem:ERRor?" query, and get the result string.
m_IoObject.WriteString(":SYSTem:ERRor?", true);
strInstrumentError = m_IoObject.ReadString();
// If there is an error, print it.
if (strInstrumentError.ToString() != "+0,\"No error\"\n")
{
if (bFirstError)
{
// Print the command that caused the error.
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