690 Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide
12 Programming Examples
'
' Agilent SICL Example in Visual Basic
' -------------------------------------------------------------------
' This program illustrates a few commonly-used programming
' features of your Agilent oscilloscope.
' -------------------------------------------------------------------
Option Explicit
Public id As Integer ' Session to instrument.
' Declare variables to hold numeric values returned by
' ivscanf/ifread.
Public dblQueryResult As Double
Public Const ByteArraySize = 5000000
Public retCount As Long
Public byteArray(ByteArraySize) As Byte
' Declare fixed length string variable to hold string value returned
' by ivscanf.
Public strQueryResult As String * 200
'
' Main Program
' -------------------------------------------------------------------
Sub Main()
On Error GoTo ErrorHandler
' Open a device session using the SICL_ADDRESS.
id = iopen("lan[130.29.69.12]:inst0")
Call itimeout(id, 5000)
' Initialize - start from a known state.
Initialize
' Capture data.
Capture
' Analyze the captured waveform.
Analyze
' Close the vi session and the resource manager session.
Call iclose(id)
Exit Sub
ErrorHandler:
MsgBox "*** Error :"+Error, vbExclamation
End
End Sub
'
' Initialize the oscilloscope to a known state.