Programming Examples
40
Keysight InfiniiVision M9241/42/43A PXIe Oscilloscopes SCPI Programmer's Guide
1379
On Error GoTo VisaComError
' Create the VISA COM I/O resource.
Set myMgr = New VisaComLib.ResourceManager
Set myScope = New VisaComLib.FormattedIO488
Set myScope.IO = _
myMgr.Open("TCPIP0::10.112.94.136::hislip9-0.0::INSTR")
myScope.IO.Clear
' Clear the interface.
myScope.IO.Timeout = 10000
' Set I/O communication timeout.
' Initialize - start from a known state.
Initialize
' Capture data.
Capture
' Analyze the captured waveform.
Analyze
Exit Sub
VisaComError:
MsgBox "VISA COM Error:" + Err.Description
End
End Sub
'
' Initialize the oscilloscope to a known state.
' -------------------------------------------------------------------
Private Sub Initialize()
On Error GoTo VisaComError
' Get and display the device's *IDN? string.
strQueryResult = DoQueryString("*IDN?")
Debug.Print "Identification string: " + strQueryResult
' Clear status and load the default setup.
DoCommand "*CLS"
DoCommand "*RST"
Exit Sub
VisaComError:
MsgBox "VISA COM Error:" + Err.Description
End
End Sub
'
' Capture the waveform.
' -------------------------------------------------------------------
Private Sub Capture()