Agilent Technologies InfiniiVision 5000 Series Programmer's Manual page 672

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

Advertisement

12
Programming Examples
VISA COM Examples
VISA COM Example in Visual Basic
To run this example in Visual Basic for Applications (VBA):
1
2
3
4
5
6
7
'
' Agilent VISA COM Example in Visual Basic
' -------------------------------------------------------------------
' This program illustrates most of the commonly used programming
' features of your Agilent oscilloscopes.
' -------------------------------------------------------------------
Option Explicit
Public myMgr As VisaComLib.ResourceManager
Public myScope As VisaComLib.FormattedIO488
Public varQueryResult As Variant
Public strQueryResult As String
'
' MAIN PROGRAM
' -------------------------------------------------------------------
' This example shows the fundamental parts of a program (initialize,
' capture, analyze).
'
' The commands sent to the oscilloscope are written in both long and
' short form.
'
' The input signal is the probe compensation signal from the front
' panel of the oscilloscope connected to channel 1.
672
"VISA COM Example in Visual Basic"
"VISA COM Example in C#"
"VISA COM Example in Visual Basic .NET"
Start the application that provides Visual Basic for Applications (for
example, Microsoft Excel).
Press ALT+F11 to launch the Visual Basic editor.
Reference the Agilent VISA COM library:
Choose Tools>References... from the main menu.
a
In the References dialog, check the "VISA COM 3.0 Type Library".
b
Click OK.
c
Choose Insert>Module.
Cut- and- paste the code that follows into the editor.
Edit the program to use the VISA address of your oscilloscope, and save
the changes.
Run the program.
Both forms are acceptable.
Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide
on page 672
on page 682
on page 693

Advertisement

Table of Contents
loading

Table of Contents