Agilent Technologies InfiniiVision 5000 Series Programmer's Manual page 727

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

Advertisement

Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide
// Send the command to the device.
string strCommandAndLength;
int nViStatus, nLength, nBytesWritten;
nLength = DataArray.Length;
strCommandAndLength = String.Format("{0} #8{1:D8}",
strCommand, nLength);
// Write first part of command to formatted I/O write buffer.
nViStatus = visa32.viPrintf(m_nSession, strCommandAndLength);
CheckVisaStatus(nViStatus);
// Write the data to the formatted I/O write buffer.
nViStatus = visa32.viBufWrite(m_nSession, DataArray, nLength,
out nBytesWritten);
CheckVisaStatus(nViStatus);
// Write command termination character.
nViStatus = visa32.viPrintf(m_nSession, "\n");
CheckVisaStatus(nViStatus);
// Check for instrument errors (another command and result).
CheckForInstrumentErrors(strCommand);
return nBytesWritten;
}
public StringBuilder DoQueryString(string strQuery)
{
// Send the query.
VisaSendCommandOrQuery(strQuery);
// Get the result string.
StringBuilder strResults = new StringBuilder(1000);
strResults = VisaGetResultString();
// Check for instrument errors (another command and result).
CheckForInstrumentErrors(strQuery);
// Return string results.
return strResults;
}
public double DoQueryValue(string strQuery)
{
// Send the query.
VisaSendCommandOrQuery(strQuery);
// Get the result string.
double fResults;
fResults = VisaGetResultValue();
// Check for instrument errors (another command and result).
CheckForInstrumentErrors(strQuery);
// Return string results.
return fResults;
Programming Examples
727
12

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents