Programming Examples 12
Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide 745
'
' If you are using a different signal or different channels, these
' commands may not work as explained in the comments.
' -------------------------------------------------------------------
Sub Main()
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
' DIGITIZE command.
Capture
' Analyze - Once the waveform has been captured, it can be analyzed.
' There are many parts of a waveform to analyze. This example shows
' some of the possible ways to analyze various parts of a waveform.
Analyze
Exit Sub
VisaComError:
MsgBox "VISA COM Error:" + vbCrLf + Err.Description
End Sub
'
' Initialize
' -------------------------------------------------------------------
' Initialize will start the program with the oscilloscope in a known
' state. This is required because some uninitialized conditions could
' cause the program to fail or not perform as expected.
'
' In this example, we initialize the following:
' - Oscilloscope
' - Channel 1 range
' - Display Grid
' - Timebase reference, range, and delay
' - Trigger mode and type
'