• RE: How to get screen caputure from DPO7000 series using VBA

    My code is below, and there's error 'VI_ERROR_TME' on 'imageBytes = osc.ReadIEEEBlock(BinaryType_UI1, True)' line.<br> What should I do?<br> <br> Please Somebody Helps Me!!!<br> <br> <br> --------------------------------------------------------------------------------------------------------------------------------------------------------<br> Public Declare PtrSafe Sub Sleep Lib &quot;kernel32&quot; (ByVal dwMilliseconds As LongPtr)<br> <br> Public OSC_ioMgr As New VISAComLib.ResourceManager<br> Public osc As New VISAComLib.FormattedIO488<br> Public OSC_GPIO As String<br> <br> Public imageBytes() As Byte<br> <br> Sub CaptureScreen()<br> <br> &#160;' Connect to the oscilloscope<br> &#160; &#160; Set osc.IO = OSC_ioMgr.Open(&quot;GPIB0::15::INSTR&quot;)<br> &#160; &#160;&#160;<br> &#160; &#160; ' Set up the oscilloscope for screen capture<br> &#160; &#160; osc.WriteString &quot;HARDCOPY:FORMAT BMP&quot;<br> &#160; &#160; osc.WriteString &quot;HARDCOPY:Port FILE&quot;<br> &#160; &#160; osc.WriteString &quot;HARDCOPY:PALETTE INKSAVER&quot;<br> &#160; &#160; osc.WriteString &quot;HARDCOPY:FILENAME &quot;&quot;FILE_INKSAVER&quot;&quot;&quot;<br> &#160; &#160; osc.WriteString &quot;HARDCOPY START&quot;<br> &#160; &#160;&#160;<br> &#160; &#160; Sleep 2000 ' Wait for 2 seconds<br> &#160; &#160;&#160;<br> &#160; &#160; imageBytes = osc.ReadIEEEBlock(BinaryType_UI1, True)<br> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160;<br> &#160; &#160; 'Save image to a temporary file<br> &#160; &#160; fileNumber = FreeFile<br> &#160; &#160; 'Open &quot;D:\temp.jpg&quot; For Binary Lock Read Write As #fileNumber<br> &#160; &#160; Open &quot;D:\temp.jpg&quot; For Binary Lock Read Write As #fileNumber<br> &#160; &#160; Put #fileNumber, , imageBytes<br> &#160; &#160; Close #fileNumber<br> &#160; &#160;&#160;<br> &#160; &#160; 'Load the image back into Excel<br> &#160; &#160; Dim picture As Shape<br> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160;<br> &#160; &#160; Set picture = Sheets(&quot;Sheet1&quot;).Shapes.AddPicture(&quot;D:\temp.jpg&quot;, msoFalse, msoTrue, Sheets(&quot;Sheet1&quot;).Cells(&quot;A1&quot;).Left, Sheets(&quot;Sheet1&quot;).Cells(&quot;A1&quot;).Top, 1024 * 0.5, 768 * 0.5)<br> <br> End Sub<br> <br> &#160;
  • How to get screen caputure from DPO7000 series using VBA

    Hi,<br> <br> I am using DPO7254C and I am making a VBA code to create automatic system.<br> <br> But I don't know how to create the code to get the screen captured from oscilloscope by VBA.<br> <br> I just want to get the screen and paste to specific cell in excel that I want.<br> <br> Please let me know the code.<br> <br> Thanks.<br> <br> &#160;