Page 1 of 1

Hardcopy, Ethernet and C# on MDO3024

Posted: January 24th, 2019, 4:28 pm
by flo617
Hello,

I'm trying to get a hardcopy from an MDO3024 onto my PC over ethernet.

I have done it successfully with Python and USB but now I need to get it done through C#, preferably over Ethernet and I am running into problems.

I can query and send command OK but when I issue the "HARDCOPY START" command I don't seem to get anything back although the scope flashes so I know a hardcopy is initiated. An "*ESR?" query returns 4.

I was expecting to get the bytes of the file as a response. Am I missing something?

appart from the initial "*CLS" and "*IDN?" commands, the only other things I am settings are " SAVe:IMAGe:FILEFormat PNG" and ""SAVe:IMAGe:INKSaver ON""

Thanks for your help

Re: Hardcopy, Ethernet and C# on MDO3024

Posted: January 24th, 2019, 5:01 pm
by David N
Have you looked at the remote programming examples section on the forum? You may find an example that is close to the task you are trying to accompolish. viewtopic.php?f=580&t=133570

Re: Hardcopy, Ethernet and C# on MDO3024

Posted: January 24th, 2019, 5:41 pm
by flo617
Oh and querying "ALLEv?" returns "Querry INTERRUPTED"

Yes I have looked at some of those links but I'm not clear why there is nothing going on the stream after the "hardcopy start" command.

I'm monitoring the exchange between the scope and the pc with Wireshark but there is no byte returned by the scope after the hardcopy start so I don't see what I can do unless I missed a config line somewhere.

Also I am not using a VISA layer for the communication, just plain scpi

Re: Hardcopy, Ethernet and C# on MDO3024

Posted: January 29th, 2019, 11:44 am
by Carl M
The hardcopy command isn't supported on raw socket connections. To get screen captures without VISA or VXI-11, you might try accessing eScope, the web server on the instrument. HTTP client libraries are readily available. I don't know how to do it in C# but in Python 3 it is the following

Code: Select all

import urllib.request
screen = urllib.request.urlopen('http://192.168.1.116:81/image.png')
with open('myfile.png', 'wb') as f:
    f.write(screen.read())
replace 192.168.1.116 with your MDO's ip or hostname

Re: Hardcopy, Ethernet and C# on MDO3024

Posted: January 30th, 2019, 11:00 pm
by flo617
Thank you Carl.

So far I managed to get by by mounting a network drive on the scope and saving the hardcopy to it. However it is not ideal for various reasons.

Therefore I will try to implement your method. Thank you!

Florent

Re: Hardcopy, Ethernet and C# on MDO3024

Posted: February 1st, 2019, 11:11 am
by flo617
Works very well. Thanks again for the quick support.