926 Keysight InfiniiVision DSOX1204A/G Oscilloscopes Programmer's Guide36 Programming Examples' -------------------------------------------------------------------Private Sub Analyze()On Error GoTo ErrorHandler' Make a couple of measurements.' -----------------------------------------------------------------DoCommand ":MEASure:SOURce CHANnel1"Debug.Print "Measure source: " + _DoQueryString(":MEASure:SOURce?")DoCommand ":MEASure:FREQuency"dblQueryResult = DoQueryNumber(":MEASure:FREQuency?")MsgBox "Frequency:" + vbCrLf + _FormatNumber(dblQueryResult / 1000, 4) + " kHz"DoCommand ":MEASure:VAMPlitude"dblQueryResult = DoQueryNumber(":MEASure:VAMPlitude?")MsgBox "Vertical amplitude:" + vbCrLf + _FormatNumber(dblQueryResult, 4) + " V"' Download the screen image.' -----------------------------------------------------------------DoCommand ":HARDcopy:INKSaver OFF"' Get screen image.Dim lngBlockSize As LonglngBlockSize = DoQueryIEEEBlock_Bytes(":DISPlay:DATA? PNG, COLor")Debug.Print "Screen image bytes: " + CStr(lngBlockSize)' Save screen image to a file:Dim strPath As StringstrPath = "c:\scope\data\screen.png"If Len(Dir(strPath)) ThenKill strPath ' Remove file if it exists.End IfDim hFile As LonghFile = FreeFileOpen strPath For Binary Access Write Lock Write As hFileDim lngI As Long' Skip past header.For lngI = CInt(Chr(byteArray(1))) + 2 To lngBlockSize - 1Put hFile, , byteArray(lngI) ' Write data.Next lngIClose hFile ' Close file.MsgBox "Screen image written to " + strPath' Download waveform data.' -----------------------------------------------------------------' Set the waveform points mode.DoCommand ":WAVeform:POINts:MODE RAW"Debug.Print "Waveform points mode: " + _DoQueryString(":WAVeform:POINts:MODE?")' Get the number of waveform points available.