Visa 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 Example in Visual Basic

'
' Agilent VISA Example in Visual Basic
' -------------------------------------------------------------------
' This program illustrates most of the commonly-used programming
' features of your Agilent oscilloscope.
' -------------------------------------------------------------------
Option Explicit
Public err As Long
Public drm As Long
Public vi As Long
' Declare variables to hold numeric values returned by
' viVScanf/viVQueryf.
Public dblQueryResult As Double
Public Const DblArraySize = 20
Public Const ByteArraySize = 5000000
Public retCount As Long
Public dblArray(DblArraySize) As Double
Public byteArray(ByteArraySize) As Byte
Public paramsArray(2) As Long
' Declare fixed length string variable to hold string value returned
' by viVScanf/viVQueryf.
Public strQueryResult As String * 200
'
' 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()
604
' Error returned by VISA function calls.
' Session to Default Resource Manager.
' Session to instrument.
Both forms are acceptable.
' Open the default resource manager session.
err = viOpenDefaultRM(drm)
'
Open the session to the resource.
'
The "GPIB0" parameter is the VISA Interface name to
'
an GPIB instrument as defined in:
'
Start->Programs->Agilent IO Libraries->IO Config
'
Change this name to whatever you have defined for your
Agilent 6000 Series Oscilloscopes Programmer's Reference

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents