Re: OT: I/V curve tracing made easy with Python and PyVISA
Hi Tony,toggle quoted messageShow quoted text
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 (http://www.hakanh.com/dl/index.htm) 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
csa=gpib.dev(0,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.
result=gpib.read(csa,1000) # read ID and store in result
# another example
print(gpib.read(csa,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: