186 Keysight InfiniiVision DSOX1204A/G Oscilloscopes Programmer's Guide8 :ACQuire CommandsOption ExplicitPublic myMgr As VisaComLib.ResourceManagerPublic myScope As VisaComLib.FormattedIO488Public varQueryResult As VariantPublic strQueryResult As StringPrivate Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)Sub Main()On Error GoTo VisaComError' Create the VISA COM I/O resource.Set myMgr = New VisaComLib.ResourceManagerSet myScope = New VisaComLib.FormattedIO488Set 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.ReadStringDebug.Print "Acquisition mode: " + strQueryResult' Set the number of segments to 25.myScope.WriteString ":ACQuire:SEGMented:COUNt 25"myScope.WriteString ":ACQuire:SEGMented:COUNt?"strQueryResult = myScope.ReadStringDebug.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."DoSleep 100 ' Small wait to prevent excessive queries.myScope.WriteString ":WAVeform:SEGMented:COUNt?"varQueryResult = myScope.ReadNumberLoop Until varQueryResult = 25Debug.Print "Number of segments in acquired data: " _+ FormatNumber(varQueryResult)Dim lngSegments As LonglngSegments = varQueryResult' For each segment:Dim dblTimeTag As Double