Agilent Technologies Infiniium 90000 Series Programmer's Manual page 1089

Oscilloscopes
Hide thumbs Also See for Infiniium 90000 Series:
Table of Contents

Advertisement

Agilent Infiniium 90000 Series Oscilloscopes Programmer's Reference
}
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? STRing");
strInstrumentError = VisaGetResultString();
if (!strInstrumentError.ToString().StartsWith("0,"))
{
if (bFirstError)
{
Console.WriteLine("ERROR(s) for command '{0}': ",
strCommand);
bFirstError = false;
}
Console.Write(strInstrumentError);
}
} while (!strInstrumentError.ToString().StartsWith("0,"));
}
private void OpenResourceManager()
{
int nViStatus;
nViStatus =
visa32.viOpenDefaultRM(out this.m_nResourceManager);
if (nViStatus < visa32.VI_SUCCESS)
throw new
ApplicationException("Failed to open Resource Manager");
}
private void OpenSession()
{
int nViStatus;
nViStatus = visa32.viOpen(this.m_nResourceManager,
this.m_strVisaAddress, visa32.VI_NO_LOCK,
visa32.VI_TMO_IMMEDIATE, out this.m_nSession);
CheckVisaStatus(nViStatus);
}
public void SetTimeoutSeconds(int nSeconds)
{
int nViStatus;
nViStatus = visa32.viSetAttribute(this.m_nSession,
visa32.VI_ATTR_TMO_VALUE, nSeconds * 1000);
CheckVisaStatus(nViStatus);
}
public void CheckVisaStatus(int nViStatus)
{
// If VISA error, throw exception.
if (nViStatus < visa32.VI_SUCCESS)
38
Sample Programs
1089

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents