Visa Com Example In Visual Basic - Agilent Technologies MSO6102A Programmer's Reference Manual

6000 series
Hide thumbs Also See for MSO6102A:
Table of Contents

Advertisement

9
Programming Examples

VISA COM Example in Visual Basic

'
' 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.
'
' If you are using a different signal or different channels, these
' commands may not work as explained in the comments.
' -------------------------------------------------------------------
Sub Main()
614
Both forms are acceptable.
On Error GoTo VisaComError
' Create the VISA COM I/O resource.
Set myMgr = New VisaComLib.ResourceManager
Set myScope = New VisaComLib.FormattedIO488
' GPIB.
'Set myScope.IO = myMgr.Open("GPIB0::7::INSTR")
' LAN.
'Set myScope.IO = myMgr.Open("TCPIP0::a-mso6102-90541::inst0::INSTR")
' USB.
Set myScope.IO = myMgr.Open("USB0::2391::5970::30D3090541::0::INSTR")
' Initialize - Initialization will start the program with the
' oscilloscope in a known state.
Initialize
' Capture - After initialization, you must make waveform data
' available to analyze.
To do this, capture the data using the
Agilent 6000 Series Oscilloscopes Programmer's Reference

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents