Can't get Keithley 196 GPIB to work - Page 1
Forum section: electronics / testgear

author: cellularmitosis
author_rank: Unknown
timestamp: April 25, 2017, 06:44:36 am
content: Hey there!A while back I bought a Keithley 196 and a GPIB-USB adapter (the Galvant Industries open hardware one), but I can't seem to get any sort of GPIB to work with it.A big thanks to user JBeale who posted a python script which he used to get some readings out of his Keithley 196 using GPIB:https://www.eevblog.com/forum/testgear/my-keithley-196-is-on-its-way/msg493421/#msg493421Unfortunately, I haven't been able to replicate his successI used the front-panel interface to figure out that my unit is still set to the factory default address of '7'.I can successfully send some commands to the adapter itself, but I can't seem to read anything from the 196.For example, I can send the adapter "+test":Code:ser.write("+test\r")time.sleep(0.1)print ser.readline()which prints "testing"I can check the firmware version of the GPIB-USB adapter:Code:ser.write("+ver\r")time.sleep(0.1)print ser.readline()which prints "4".It seems that I can set the adapter to talk to address 7:Code:ser.write("+a:7\r")time.sleep(0.1)print ser.readline()but I'm not sure if that's actually doing anything, because it doesn't print a response.When I try to get a reading out of it:Code:ser.write("?\r")time.sleep(0.1)print ser.readline()it just doesn't return anything (it returns the empty string).This is the line I'm using to set up the serial connection:Code:ser = serial.Serial("/dev/tty.usbserial-DB00F6OG", 460800, 8, 'N', 1, timeout=1)I've found both the 196 manual as well as a "programming" manual:https://doc.xdevs.com/doc/Keithley/196/196_903_01A.pdfI understand that I should be able to send it commands, for example "F3X" to set it to DC current mode.But I can't seem to figure out how to get a reading out of it.Hopefully I'm just missing something obvious here?

author: JBeale
author_rank: Frequent Contributor
timestamp: April 25, 2017, 02:04:56 pm
content: I suppose it's possible there is a hardware issue either in your GPIB cable (unless you've been able to test it with any other instrument) or the GPIB adaptor or in the Keithley meter itself. I don't know what to say about the software side; my code worked as I indicated in the thread. I haven't used my meter in a while, I think there is a "LOCAL" button next to the power button which may turn on/off GPIB (?)

author: Dr. Frank
author_rank: Super Contributor
timestamp: April 25, 2017, 02:32:43 pm
content: The LOCAL button usually terminates the REMOTE state only, i.e. you can take over manual control again, when the instrument had been addressed and put in remote before.I would also check the cable for continuity, and the line signals, if the bus is working, or if the input or output driver is damaged.Frank

author: Marcus_S
author_rank: Contributor
timestamp: April 25, 2017, 06:03:46 pm
content: Hi,some instruments/multimeters (e. g. 3456A) seem to be configured by receiving a string (e. g. F3X) from the GPIB-bus only. But for sending a reading over the bus or performing the desired action they seem to need a separate trigger event (something like GET) also (see page 46 of the linked manual, program line 30 and 40). This is explained much better in the programming manual of the Keithley 220/230. With this I got my 3456A working with the Prologix-adapter and EZGPIB yesterday using this sequence:const HP3456A = 22; // adress 3456A...ezgpib_BusWriteData(HP3456A,'10STI'); // 10 number of integration cyclesezgpib_BusWriteData(HP3456A,'5STG'); // 5 number of digitsezgpib_BusWriteData(HP3456A,'F4R1M0T4'); // 2W-res. 10k range math off trigger holdEZGPIB_BusTrigger(HP3456A);EZGPIB_BusWaitForData(HP3456A,Answer,5.0);EZGPIB_ScreenWriteLn(Answer);Best regardsMarcus

author: cellularmitosis
author_rank: Unknown
timestamp: April 26, 2017, 02:38:49 pm
content: Thanks for the suggestions everyone!I wasn't able to get it working, but I can see that the front-panel interface of the 196 "resets" a couple of seconds after I try to send it a command -- perhaps the GPIB controller in it is timing out and resetting because it isn't getting what it expected. That might be a good sign!I also took at look at InstrumentKit, a Python library which creates an abstraction layer across many GPIB devices, written by Steven who made the GPIB-USB adapter I am using. I took a look in there and lo and behold there is a driver for the Keithley 195, so I might take a shot at using that as a starting point and writing a driver for the 196.If that doesn't work, it looks like I could also write my own firmware for the PIC on his board. Perhaps I'll implement more of a "raw" mode, where instead of sending the board serial plaintext, you instead send it the exact state of what every pin should be, and it sends you back the same when receiving. That might allow me to figure out if I'm even getting any bit flips at all coming out of the 196.I'll keep you posted!

author: bitseeker
author_rank: Super Contributor
timestamp: April 26, 2017, 07:35:19 pm
content: Sounds good. If you don't have it already, you can get the full manual with the GPIB commands for the 196 athttps://archive.org/details/keithley_KEI_196_Instruction(see the programming section in chapter 3).

author: vindoline
author_rank: Unknown
timestamp: June 02, 2017, 12:36:17 am
content: Keep us informed on progress cellularmitosis, I'm considering getting the same GPIB adaptor for my Keithley 196!

author: bitseeker
author_rank: Super Contributor
timestamp: September 08, 2017, 11:13:46 pm
content: It appears that this is "to be continued" athttps://www.eevblog.com/forum/projects/atmega-gpib-yet-another-diy-gpib-to-usb-project/where cellularmitosis dives into the GPIB protocol and his GPIB board to talk to his 196.