708 Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide
12 Programming Examples
' 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. Both forms are acceptable.
'
' 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()
' 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
' VISA Interface.
' "GPIB0::7::INSTR" is the address string for the device -
' this address will be the same as seen in:
' Start->Programs->Agilent IO Libraries->VISA Assistant
' (after the VISA Interface Name is defined in IO Config).
' err = viOpen(drm, "GPIB0::7::INSTR", 0, 0, vi)
' err = viOpen(drm, "TCPIP0::a-mso6102-90541::inst0::INSTR", 0, 0, vi)
err = viOpen(drm, _
"USB0::2391::5970::30D3090541::0::INSTR", 0, 60000, vi)
' 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