I am an avid python scripter, and was wondering how I could connect/log data from an oscilloscope (I'm looking at the DSOX2004A) using Python. I'm open to using USB or Ethernet (I actually slightly prefer ethernet so I can talk to multiple devices simultaneously), but its unclear to me what the easiest way to get going is.
I've seen a few people post code, but I'd really like to have a more clear idea about what the general structure is of how to interface with the scope than simply the code to perform a specific task. I'm used to talking to arduinos over serial, but am not sure what I'm supposed to do with an oscilloscope to talk to it. Do I need PyVISA? Can it be done over a serial/usb connection?
Because Visa is based on ambiguous strings (to my opinion...) writing a high level wrapper for the PyVisa module will help you getting rid of the strings. It makes life easier. To do so, the GUIDE (6000_series_prog_guide.pdf) has been very helpfull. It lists all the functions you can use with Visa and how to use them. Of course, you will have to clean up things to make it work perfectly under Python but the wrapper is used in that purpose.
So are the somewhat ambigous strings like 'CHAN', 'ACQ', and 'APPL' part of the VISA language?
It was a bit ambiguous to me how to connect to devices from reading around on the forums, so I wrote my own driver that should operate in python. It probably repeated a lot of the efforts of pyVISA, but I hope that perhaps it's easier to read for beginners like myself?
VISA isn't a language, it's a framework. Those commands are part of the instruction set (SCPI, I believe) for the instrument in question. Quite a few instruments use the same (or very similar) commands.
It's possible to connect to instruments over LAN with pure python applications as well. I have been working on a pure Python interpretation of IVI myself that can connect to instruments with VXI-11 over LAN, among other things. It's not complete yet, but it may be of use to someone: https://github.com/alexforencich/python-ivi .