Re: OT: I/V curve tracing made easy with Python and PyVISA

Albert Otten

Hi Tony,

Your 2465 doesn't have RS232, so you need a GPIB connection. Do you have such already (NI GPIB-USB-HS, Prologix,...)? I have the NI adapter. Or are you considering to use an Arduino (mentioned in your 2465 topic) for this? I know nothing of Arduinos (except that my son is married with these tiny things).
Tektronix had it's own version of NI-VISA, TekVISA, and a program Wavestar. These could be downloaded for free I think for Windows. I tried this once without much success and deleted it right away: together with NI drivers a HUGE amount of software! I used Linux ever since with the linux-gpib driver package. I don't know if the GPIB programs by Hakan ( together with drivers can serve you.
In my opinion PiVISA is not of much interest for you. VISA is intended for equipment that understands VISA commands. So you have to lookup in the Opt.10 manual which commands are recognized by the 2465 and send these commands exactly as shown in the manual. I have the same situation with my 7854 and CSAs.
At this moment I don't remember for sure whether drivers are still needed if the Pivisa-py package is used, but I think the are. If not then PiVISA is attractive. (Magnus knows?)
An alternative to PiVISA is to use the python package gpib_ctypes in combination with the Linux linux-gpib package or the (Linux, Windows) NI drivers.
The python script could look like this (note, I didn't test this since some time, I hope I removed errors):


# test gpib connection with the CSA803
from gpib_ctypes import gpib
# in my case, the CSA was set address to 1,1) # get device handle
print("device handle",csa) # was 17
print("status serial poll",gpib.serial_poll(csa))
# serial poll seems needed as first command as response to SRQ request issued by CSA at startup

gpib.write(csa,b'ID?') # no \r\n needed, EOI takes care of this
# in interactive mode the command also receives and prints the status byte, 8448.,1000) # read ID and store in result

# another example
print(,1000)) # result immediately shown now

The DMM Opt.1 recognizes some additional GPIB commands.


On Fri, May 17, 2019 at 06:24 PM, Tony Fleming wrote:

Magnus, and most or all of you are in a "stratosphere" compared to me, who
is trying to learn my Tektronix 2465 DMS! But I also have P6407 and I would
like to learn how to use it.
Can anyone out there help me with something simple I can try to connect it?
I never have anything like this before, so use very simple terms what all I
need please.
You all were very helpful with my scope, when it was sick and now it works,
thanks to you all. I found this group to be the most helpful group out
Thank you very much.

Join to automatically receive all group messages.