Agilent Technologies InfiniiVision 4000 X-Series Programmer's Manual page 237

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

Advertisement

Option Explicit
Public myMgr As VisaComLib.ResourceManager
Public myScope As VisaComLib.FormattedIO488
Public varQueryResult As Variant
Public strQueryResult As String
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub Main()
Agilent InfiniiVision 4000 X-Series Oscilloscopes Programmer's Guide
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("USB0::0x0957::0x17A6::US50210029::0::INSTR")
myScope.IO.Clear
' Clear the interface.
' Turn on segmented memory acquisition mode.
myScope.WriteString ":ACQuire:MODE SEGMented"
myScope.WriteString ":ACQuire:MODE?"
strQueryResult = myScope.ReadString
Debug.Print "Acquisition mode: " + strQueryResult
' Set the number of segments to 25.
myScope.WriteString ":ACQuire:SEGMented:COUNt 25"
myScope.WriteString ":ACQuire:SEGMented:COUNt?"
strQueryResult = myScope.ReadString
Debug.Print "Acquisition memory segments: " + strQueryResult
' If data will be acquired within the IO timeout:
'myScope.IO.Timeout = 10000
'myScope.WriteString ":DIGitize"
'Debug.Print ":DIGitize blocks until all segments acquired."
'myScope.WriteString ":WAVeform:SEGMented:COUNt?"
'varQueryResult = myScope.ReadNumber
' Or, to poll until the desired number of segments acquired:
myScope.WriteString ":SINGle"
Debug.Print ":SINGle does not block until all segments acquired."
Do
Sleep 100
' Small wait to prevent excessive queries.
myScope.WriteString ":WAVeform:SEGMented:COUNt?"
varQueryResult = myScope.ReadNumber
Loop Until varQueryResult = 25
Debug.Print "Number of segments in acquired data: " _
+ FormatNumber(varQueryResult)
Dim lngSegments As Long
lngSegments = varQueryResult
' For each segment:
Dim dblTimeTag As Double
Dim lngI As Long
7
:ACQuire Commands
237

Advertisement

Table of Contents
loading

Table of Contents