Technical data

960 Agilent Infiniium 90000 Series Oscilloscopes Programmer's Reference
35 Sample Programs
private void CheckInstrumentErrors(string strCommand)
{
// Check for instrument errors.
string strInstrumentError;
bool bFirstError = true;
do // While not "0,No error".
{
m_IoObject.WriteString(":SYSTem:ERRor? STRing", true);
strInstrumentError = m_IoObject.ReadString();
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 OpenIo()
{
m_ResourceManager = new ResourceManagerClass();
m_IoObject = new FormattedIO488Class();
// Open the default VISA COM IO object.
try
{
m_IoObject.IO =
(IMessage)m_ResourceManager.Open(m_strVisaAddress,
AccessMode.NO_LOCK, 0, "");
}
catch (Exception e)
{
Console.WriteLine("An error occurred: {0}", e.Message);
}
}
public void SetTimeoutSeconds(int nSeconds)
{
m_IoObject.IO.Timeout = nSeconds * 1000;
}
public void Close()
{
try
{
m_IoObject.IO.Close();
}
catch { }
try
{