Visa Com Example In Visual Basic .Net - Agilent Technologies InfiniiVision 5000 Series Programmer's Manual

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

Advertisement

}

VISA COM Example in Visual Basic .NET

To compile and run this example in Microsoft Visual Studio 2005:
1
2
3
Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide
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
{
Marshal.ReleaseComObject(m_IoObject);
}
catch {}
try
{
Marshal.ReleaseComObject(m_ResourceManager);
}
catch {}
}
}
Open Visual Studio.
Create a new Visual Basic, Windows, Console Application project.
Cut- and- paste the code that follows into the C# source file.
Programming Examples
765
12

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents