Tektronix Technical Forums are maintained by community involvement. Feel free to post questions or respond to questions by other members. Should you require a time-sensitive answer, please contact your local Tektronix support center here.

Hardcopy, Ethernet and C# on MDO3024

Post Reply
flo617
Posts: 4
Joined: January 24th, 2019, 4:18 pm
Country: United States

Hardcopy, Ethernet and C# on MDO3024

Post by flo617 » January 24th, 2019, 4:28 pm

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

David N
Tektronix Applications
Tektronix Applications
Posts: 550
Joined: July 31st, 2008, 8:26 am

Re: Hardcopy, Ethernet and C# on MDO3024

Post by David N » January 24th, 2019, 5:01 pm

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

flo617
Posts: 4
Joined: January 24th, 2019, 4:18 pm
Country: United States

Re: Hardcopy, Ethernet and C# on MDO3024

Post by flo617 » January 24th, 2019, 5:41 pm

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

Carl M
Tektronix Applications
Tektronix Applications
Posts: 797
Joined: July 30th, 2008, 4:45 pm
Country: United States

Re: Hardcopy, Ethernet and C# on MDO3024

Post by Carl M » January 29th, 2019, 11:44 am

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
Tektronix Application Engineer

flo617
Posts: 4
Joined: January 24th, 2019, 4:18 pm
Country: United States

Re: Hardcopy, Ethernet and C# on MDO3024

Post by flo617 » January 30th, 2019, 11:00 pm

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

flo617
Posts: 4
Joined: January 24th, 2019, 4:18 pm
Country: United States

Re: Hardcopy, Ethernet and C# on MDO3024

Post by flo617 » February 1st, 2019, 11:11 am

Works very well. Thanks again for the quick support.

Post Reply

Return to “Programming Support”

Who is online

Users browsing this forum: No registered users and 3 guests