Programming Examples 36Keysight InfiniiVision DSOX1204A/G Oscilloscopes Programmer's Guide 829strPath = "c:\scope\config\setup.stp"DataArray = File.ReadAllBytes(strPath)nBytesWritten = DataArray.Length' Restore setup string.myScope.DoCommandIEEEBlock(":SYSTem:SETup", DataArray)Console.WriteLine("Setup bytes restored: {0}", nBytesWritten)' Capture an acquisition using :DIGitize.myScope.DoCommand(":DIGitize CHANnel1")End Sub' Analyze the captured waveform.' --------------------------------------------------------------Private Shared Sub Analyze()Dim fResult As DoubleDim ResultsArray As Byte() ' Results array.Dim nLength As Integer ' Number of bytes returned from inst.Dim strPath As String' Make a couple of measurements.' ------------------------------------------------------------myScope.DoCommand(":MEASure:SOURce CHANnel1")Console.WriteLine("Measure source: {0}", _myScope.DoQueryString(":MEASure:SOURce?"))myScope.DoCommand(":MEASure:FREQuency")fResult = myScope.DoQueryNumber(":MEASure:FREQuency?")Console.WriteLine("Frequency: {0:F4} kHz", fResult / 1000)myScope.DoCommand(":MEASure:VAMPlitude")fResult = myScope.DoQueryNumber(":MEASure:VAMPlitude?")Console.WriteLine("Vertical amplitude: {0:F2} V", fResult)' Download the screen image.' ------------------------------------------------------------myScope.DoCommand(":HARDcopy:INKSaver OFF")' Get the screen data.ResultsArray = myScope.DoQueryIEEEBlock(":DISPlay:DATA? PNG, COLor")nLength = ResultsArray.Length' Store the screen data to a file.strPath = "c:\scope\data\screen.png"Dim fStream As FileStreamfStream = File.Open(strPath, FileMode.Create)fStream.Write(ResultsArray, 0, nLength)fStream.Close()Console.WriteLine("Screen image ({0} bytes) written to {1}", _nLength, strPath)' Download waveform data.' ------------------------------------------------------------