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.
I'm trying to convert visa code to use the socket interface with an MSO4104B.
I'm using the following as my starting point and it's working fine for the most part:
viewtopic.php?f=568&t=137002&hilit=sock ... e+read_raw
But the code I use to get the screen shot as a PNG file on the PC uses read_raw after a HARDCOPY START just like in this example:
raw_data = scope.read_raw()
fid = open('my_image.png', 'wb')
This works fine with visa but not with the socket interface. The read function function of the Socket_Instrument class locks up. I get two blank characters and then it hangs in the 'except' portion of the code, never getting to the 'break'.
response = ''
char = ""
char = self.s.recv(1)
if response.rstrip() != "":
response += char
I tried to create a read_raw function in the classs from read by taking out the .rstrip portions and keeping the character arrays as they came in. But that doesn't change the issue. It's as if there's no data there or the socket interface is accessing the wrong location?
Has anyone used the socket interface to get the screen shot and write it to a file in this way? What would a socket version of read_raw look like?
Thanks in advance
Who is online
Users browsing this forum: No registered users and 4 guests