Agilent Technologies InfiniiVision 3000 X-Series Programmer's Manual page 1191

Oscilloscopes
Hide thumbs Also See for InfiniiVision 3000 X-Series:
Table of Contents

Advertisement

' This program illustrates a few 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 ByteArraySize = 5000000
Public retCount As Long
Public byteArray(ByteArraySize) As Byte
Public paramsArray(2) As Long
Public Const DblArraySize = 20
Public dblArray(DblArraySize) As Double
' Declare fixed length string variable to hold string value returned
' by viVScanf/viVQueryf.
Public strQueryResult As String * 200
' For Sleep subroutine.
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
'
' Main Program
' -------------------------------------------------------------------
Sub Main()
Agilent InfiniiVision 3000 X-Series Oscilloscopes Programmer's Guide
' Error returned by VISA function calls.
' Session to Default Resource Manager.
' Session to instrument.
' Open the default resource manager session.
err = viOpenDefaultRM(drm)
If (err <> VI_SUCCESS) Then HandleVISAError drm
' Open the session using the oscilloscope's VISA address.
err = viOpen(drm, _
"USB0::0x0957::0x17A6::US50210029::0::INSTR", 0, 15000, vi)
If (err <> VI_SUCCESS) Then HandleVISAError drm
' Set the I/O timeout to ten seconds.
err = viSetAttribute(vi, VI_ATTR_TMO_VALUE, 10000)
If (err <> VI_SUCCESS) Then HandleVISAError vi
' Initialize - start from a known state.
Initialize
' Capture data.
Capture
' Analyze the captured waveform.
Analyze
' Close the vi session and the resource manager session.
err = viClose(vi)
Programming Examples
1191
40

Advertisement

Table of Contents
loading

Table of Contents