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 looking for help achieving the following:
My need is to control a DPO 4104B scope through an application which can only use a raw socket (I didnt write the application, so I do not have choice on that... if no solution found, I'll have to rewrite it)
I made a raw socket which I use to send commands en read the answer.
This works well for most of the commands: *IDN etc work fine
I succeeded in save a screeshot on the usb drive using SAVe:IMage "E:/my_screenshot.png" (the screehshot is actually correctly saved as a .png file on the usb drive)
as I said, most of the commands and querry work well: I can get information about the scope state and configure it.
but when I send the command FILESYSTEM:READFile "E:/my_screenshot.png" and then try to read the answer (I expect a binary frame), I always run to TimeOut Error.
I tried using the visa python API, using something like data = scope.querry( FILESYSTEM:READFile "E:/my_screenshot.png"), and this work well, I retrive the binary and write it on the PC.
So why can't I have it wor;king with the raw socket ? I guess that the query method from VISA api is basically a write followed by a read, so whydoes it not work with the raw socket ?
I'll be grateful for any help !
I'm looking for a raw solution, and also, if anyone had any explaination about the different behaviour between raw sockets and VISA sockets, I'd be glad to know !
Once again, my problem is that with a raw socket using function such as write(string), and bytes read(max_size),
If i run :
- data = read(100000)
I got an answer, which is correct. This works with any querry which answer is a string
but if i run:
- write("FILESYSTEM:READFile "E:/my_screeshot.png"
- data = read(100000)
I raise a TimeOut. Not a single byte received. This NEVER WORK for any cmd which answer is a binary frame
I don't understand the difference with using VISA (except that it works with VISA) to explain it and find a solution
Alternatively, VXI-11 (the typical VISA TCPIP connection) is a protocol specifically developed for instrument control. As such, VXI-11 has headers and the necessary metadata to detect low level connectivity problems and will raise exceptions as necessary. the design of VXI-11 guarantees robustness.
Which one is "better" is entirely dependent on your application and preferences. VXI-11 is robust but has a performance penalty. Raw sockets is greater control and efficiency but increases the software development burden.
I generally do not recommend the use of raw sockets with VISA.
But I still don't get the following point:
When i send, let's says <*IDN?\n> through the socket, and then just read on it, I get the answer correctly
So sending <FILESYSTEM:READFile "E:/my_screenshot.png"\n> should at least result in reading a part of the answer, doesnt it ? I can't understand why the tiemout error, even with a very long delay (30s), while it works perfectly using the visa API (and is done within a few ms duration)
I'm not talking about parsing the binaries data retrieved (which is trivial as I just want to wrtie it in a binary file without any change), just about receiving something, which I don't...
Who is online
Users browsing this forum: No registered users and 1 guest