766 Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide
12 Programming Examples
4 Edit the program to use the VISA address of your oscilloscope.
5 Add a reference to the VISA COM 3.0 Type Library:
a Right- click the project you wish to modify (not the solution) in the
Solution Explorer window of the Microsoft Visual Studio
environment.
b Choose Add Reference....
c In the Add Reference dialog, select the COM tab.
d Select VISA COM 3.0 Type Library; then click OK.
e Right- click the project you wish to modify (not the solution) in the
Solution Explorer window of the Microsoft Visual Studio environment
and choose Properties; then, select
"InfiniiVision.VisaComInstrumentApp" as the Startup object.
6 Build and run the program.
For more information, see the VISA COM Help that comes with Agilent IO
Libraries Suite 15.
'
' Agilent VISA COM Example in Visual Basic .NET
' -------------------------------------------------------------------
' This program illustrates most of the commonly used programming
' features of your Agilent oscilloscopes.
' -------------------------------------------------------------------
Imports System
Imports System.IO
Imports System.Text
Imports Ivi.Visa.Interop
Imports System.Runtime.InteropServices
Namespace InfiniiVision
Class VisaComInstrumentApp
Private Shared myScope As VisaComInstrument
Public Shared Sub Main(ByVal args As String())
Try
myScope = New _
VisaComInstrument("USB0::2391::5957::MY47250010::0::INSTR")
Initialize()
' The extras function contains miscellaneous commands that
' do not need to be executed for the proper operation of
' this example. The commands in the extras function are
' shown for reference purposes only.
' Extra(); // Uncomment to execute the extra function.
Capture()
Analyze()
Catch err As System.ApplicationException
Console.WriteLine("*** VISA Error Message : " + err.Message)