Keithley 181 GPIB control - Page 1
Forum section: electronics / general

author: acts238willy
author_rank: Regular Contributor
timestamp: November 05, 2018, 06:34:53 am
content: I want to use the Ke181 to output data to a database.I can't get Labview to control the 181 after spending daysmessing with driver downloads on both a 32 bit and 64bitLV2014 installation. All of my other gear works fine, so itisn't the programs.So... I need an NI driver/DLL to control the old beast 181.Help???

author: chuckb
author_rank: Frequent Contributor
timestamp: November 05, 2018, 01:04:02 pm
content: My experience is that the K181 (and some other early HP equipment) can't communicate on a bus with lots of other equipment. I have had good luck with 3 or fewer pieces of equipment on the same GPIB bus as the K181. I don't know if it's a capacitive loading / bus driver issue or something else. I also try to keep the GPIB cables short.This has led to the purchase of several HP USB/GPIB interfaces.

author: seebeck
author_rank: Contributor
timestamp: November 05, 2018, 02:22:49 pm
content: For the Keithley 181, please refer to the link as below:http://sine.ni.com/apps/utf8/niid_web_display.model_page?p_model_id=1579

author: acts238willy
author_rank: Regular Contributor
timestamp: November 05, 2018, 04:10:53 pm
content: seebeck, that's where I've been for the last few days.That's a Labwindoz driver from 10 years ago that doesn't workin Labview2014. The DLL wrapper that was made for it doesn'twork, either, in both 32 bit and 64 bit LV with the GPIB USB HS NI dongle.Using an agilent 82357B USB controller seems to be able to make the GPIBlights blink on the 181 after typing the 'init' code : kei181_init(11) ;wakes it up. The configuration and following codes don't work, though.I need to have somebody with a WORKING 181 tell me how theygot it to work.

author: acts238willy
author_rank: Regular Contributor
timestamp: November 05, 2018, 06:08:27 pm
content: The goal is to scan various inputs to the 181 andthen have it output data to a database of some kind.That way it can track the data without me having tohand step it and hand enter the data.Labview Home does that for the 3458.

author: alm
author_rank: Super Contributor
timestamp: November 05, 2018, 06:10:58 pm
content: For troubleshooting, I would ignore abstractions like IVI/LabView drivers, and start with the Measurement & Automation Explorer (MAX). You do have a gpib32/gpib64 compatible GPIB adapter, e.g. something supported by NI 488.2, right?Because the Keithley 181 does not support the later *IDN? command, MAX will likely not be able to identify it, but you should be able to talk to it using Communicator. Sending something like R4X should switch the range to 2 VDC and should return a string containing a reading (...DCV...). If that works, the GPIB connectivity, drivers and address are correct, and the device is not set to talk-only mode.

author: Lestron
author_rank: Newbie
timestamp: November 05, 2018, 06:53:57 pm
content: I had a similar frustration. It was simply that the 181 was set to "talk only". Solution was to set dip switch on 181 and re-start 181. I could communicate normally over GPIB.Talk only puts data on the bus, regardless of commands, and in my case caused all other devices on bus to not be recognized.

author: acts238willy
author_rank: Regular Contributor
timestamp: November 05, 2018, 08:39:42 pm
content: The 181 is all by itself on the USB dongle.

author: lowimpedance
author_rank: Super Contributor
timestamp: November 05, 2018, 10:19:03 pm
content: Are you sure there isn't a hardware fault in the 181 GPIB interface ?.

author: acts238willy
author_rank: Regular Contributor
timestamp: November 05, 2018, 11:43:30 pm
content: Lowimp, that's the reason I'm asking for a modernsetup that works ... right now, in 2018. I can thenduplicate the setup and see if the 181 works as itshould on GPIB.I know all of my GPIB stuff works fine, even the 3458which uses stone age GPIB/HPIB.

author: acts238willy
author_rank: Regular Contributor
timestamp: November 06, 2018, 07:37:32 am
content: PROGRESS!The NI communicator is now running the 181!It was the 'talk only' switch needing to be set to 'addressable'.Will fight with it more after I get up...

author: lowimpedance
author_rank: Super Contributor
timestamp: November 06, 2018, 08:51:05 am
content: Excellent, reporting back with updates of progress helps others when wrestling with old GPIB devices like the 181.

author: acts238willy
author_rank: Regular Contributor
timestamp: November 06, 2018, 06:07:26 pm
content: The Agilent 82357B is now controlling the 181 through theKeysight Connection Expert. It found the 181 when I 'rescanned'and I used the 'send commands to this instrument' at the rightside of the screen to bring up the 'Keysight interactive IO'.I set the 'options' to 2000ms, to cut down the 20 second lockouttime for a crap message to show up.Then started with the T2X and sure enough, it went to 20mV... T7Xswitched it to 1000V. The rest of the commands worked... and whenthe 'read response' was pushed, it started dumping out the readings,just like the 181 display showed at the time.Now, to figure out how to work with the numbers I copied out ofthe IO and pasted into Excel... the column is filled with...<- NDCV+0.204843E-3«x0D» the voltage and a bunch of letters.There has to be a way to strip out the letters and leave the numbers??

author: Lestron
author_rank: Newbie
timestamp: November 06, 2018, 06:44:09 pm
content: ugly but works=NUMBERVALUE(LEFT(RIGHT(F2,(LEN(F2)-7)),LEN(RIGHT(F2,(LEN(F2)-7)))-5))

author: TiN
author_rank: Super Contributor
timestamp: November 07, 2018, 07:33:56 am
content: Don't know if Keithley 181 is the same, but 182 has command to disable extra stuff and output just numeric value.

author: acts238willy
author_rank: Regular Contributor
timestamp: November 07, 2018, 07:59:30 pm
content: So, it looks like nobody here actually has a 181 running on acomputer program of some king, like NI Labview, that outputsnumerical data to a database or chart program?Talking and guessing hasn't worked so far... one workingexample is worth millions of words.

author: alm
author_rank: Super Contributor
timestamp: November 07, 2018, 08:24:03 pm
content: I've controlled one from Python using PyVISA. Don't remember anything special about it, similar to other instruments from that era with an R2D2 command set. Sounds to me like you've got things mostly working, and only need to do some string manipulation in Excel.

author: Echo88
author_rank: Frequent Contributor
timestamp: November 07, 2018, 08:33:00 pm
content: I only got my K181 to "talk only" and never got it to respond at commands. Heres my tested python-code (dont know if thats helping), which converts the NDCV-String into a float-value, then stores it in excel and displays the graph:import sysimport timeimport visaimport matplotlib.pyplot as pltimport numpy as npfig = plt.figure(figsize=(20,10))ax = fig.add_subplot(1,1,1)x = []y = []rm = visa.ResourceManager()rm.list_resources()inst = rm.open_resource("GPIB::7") #GPIB::22, kein ::INST dazuschreiben!cnt = 0with open('2mV_K181_Test.xls', 'a') as o:#o.write("sep=;\r\n") #sep=; tells excel to use semicolons as delimiters, doesnt appear visibly in excelo.write("K181;\r\n")o.close()while cnt <= 10: #amount of samplescnt+=1with open('2mV_K181_Test.xls', 'a', newline='') as o: # newline does not generate empty lines in excel anymoredata = inst.read()start = 'NDCV'end = '\r\n'Value = ((data.split(start)).split(end))dataf = float(Value)print (dataf)o.write (Value)o.close() # close filex.append(cnt)y.append(dataf)plt.plot(x,y, linewidth = 2)plt.draw()plt.xscale('linear')plt.xlabel('Samples')plt.ylabel('Voltage (V)')plt.autoscale(enable=True, axis='both', tight=True)plt.show()

author: acts238willy
author_rank: Regular Contributor
timestamp: November 07, 2018, 10:51:50 pm
content: Thank you, Echo!I can control all of the 181 functions from the Keysight Interactive IOand read out the uV and nV by giving a 'read' command. Then, it's copyand paste the data to Excel, then chart it.I'm not familiar with your computer program... does it use the NI USB HS dongle?

author: Echo88
author_rank: Frequent Contributor
timestamp: November 07, 2018, 11:25:33 pm
content: I use the GPIB-USB-HS-dongle from NI, yes.

author: acts238willy
author_rank: Regular Contributor
timestamp: November 07, 2018, 11:29:43 pm
content: The problem you had with addressing the 181...The 6th dip switch is the one that selects 'read only'or 'addressable'.Mine was set to read only by the physics departmentthat it came from - I set the switch to addressable andcould communicate fully with it.....The picture I'm trying to attach won't work... it's the switchbelow A5

author: acts238willy
author_rank: Regular Contributor
timestamp: November 07, 2018, 11:37:28 pm
content: Here 'tis

author: egonotto
author_rank: Super Contributor
timestamp: November 10, 2018, 05:17:24 am
content: Hello,I don't know if this can help you?I use a example from NI (National Instruments\NI-VISA\Examples\C\Gpib) and change it to read data from the 181You want not read the same value more than one time. Therefore the Asynchronous SRQ Event Handling Example is what you want.In my example the readings are as fast as possible (about 0.3s) and the values are saved in a file.Tell if you want more info.Best regardsegonotto

author: acts238willy
author_rank: Regular Contributor
timestamp: November 14, 2018, 06:48:20 am
content: The path you gave doesn't exist in LV 2014.I have the home version...

author: egonotto
author_rank: Super Contributor
timestamp: November 15, 2018, 02:15:22 am
content: Hello,I use example for C.I bought an used Keysight 82357B USB/GPIB interface and load some software from Keysight. Perhaps the VISA examples comes with this software.Best regardsegonotto

author: acts238willy
author_rank: Regular Contributor
timestamp: November 15, 2018, 03:22:36 am
content: Lemme go dig up the driver disc for the HPUSB GPIB dongle I have...Thanks!

author: acts238willy
author_rank: Regular Contributor
timestamp: November 16, 2018, 01:42:05 am
content: Nope... no luck.HP agilent keysight doesn't even supportTHEIR OWN 3458!I called them a few years ago... wenchview hasno 3458 support.Don't know how you're finding the virtual instrument for the 181...

author: alm
author_rank: Super Contributor
timestamp: November 16, 2018, 01:59:59 am
content: I don't see anyone in this thread talk about a virtual instrument. The Keithley 181 pre-dates the release of the first version of LabVIEW by a couple of years, so it's not surprising that there are no LabVIEW drivers available. However, these drivers are only fairly thin wrappers around VISA, so invoking VISA directly is not all that complicated. A bit more complicated if you want to wait for SRQ, but I'm sure you can find examples of how to wait for SRQ and then perform a VISA read in LabVIEW.If you are familiar with LabVIEW development, then reading the values usingVISA Readand parsing the results should be fairly straight-forward.

author: acts238willy
author_rank: Regular Contributor
timestamp: December 08, 2018, 03:37:50 am
content: I give up... I'll just read it using HP connection expert.Thanks for all of the ideas!