Keithley 2015 RS-232 woes - Page 1
Forum section: electronics / testgear

author: cellularmitosis
author_rank: Unknown
timestamp: March 25, 2018, 10:35:46 pm
content: Hello,I've been trying to communicate with my Keithley 2015 DMM via the serial port, and it seems to beep and complain about errors every time my script communicates with it.I'm not sure if this is a user problem (my script is broken), or if I don't have the right kind of serial cable, or if there is something wrong with the serial output module inside of the meter.To figure out where I'm at, can someone post a known-good working script they've used to communicate with their 2015?

author: Ash
author_rank: Regular Contributor
timestamp: March 26, 2018, 01:03:16 am
content: Hi cellularmitosis,If you can send me your script (assuming python or something similar) I'd be happy to run it against my K2015. If its on GitHub or similar send me the link, otherwise DM me and I'll send you my email address.I generally use GPIB, but happy to try. I'm sure you've checked the basics on the serial connection.. can you get it to respond to any command manually using a terminal program?Ash.

author: tooki
author_rank: Super Contributor
timestamp: March 26, 2018, 12:42:12 pm
content: Quote from: cellularmitosis on March 25, 2018, 10:35:46 pmWhat kind of serial cable are you using?I bought a cheap “USB to RS-232” cable on eBay, and it really didn’t work at all. (The K2015 would receive some commands on occasion, but I couldn’t read back anything at all.) Turns out the chinesium “USB to RS-232” cables aren’t actually RS-232 at all — just 5V TTL serial plonked onto a DB9 plug. Useless.I still need to get a proper USB to real RS-232 cable.

author: jpb
author_rank: Super Contributor
timestamp: March 26, 2018, 05:48:43 pm
content: I've not tried to communicate with my 2015 via the serial port yet.The first thing to do though if you want to just check the connection would be to send a very simple commande.g. (Some systems have *IDN as a command but I couldn't find it in the 2015 manual):VERSion?It should return the version of the command set it is running and then you'll know that you have the correct RS232 settings (or not).There are some sample programs on page 2-57 of the manual:http://w12.pwr.wroc.pl/lue/pliki/Keithley_2015.pdf

author: cellularmitosis
author_rank: Unknown
timestamp: March 26, 2018, 06:09:16 pm
content: Thanks guys! I'll take a closer look at all of these suggestions this evening.

author: Macbeth
author_rank: Super Contributor
timestamp: March 26, 2018, 07:22:48 pm
content: Watch out for how your line termination is set up. Get it wrong and you will appear to have a working system when you issue a *IDN? command for example. However there may be a CR or LF buffered there that makes the next command fail.My 2000 and 2015 are set up with 9600 baud, no flow control, and TX TERM is LF.All working using NI-VISA and cheap shitty CH340 and Prolific ebay rip-off cables. Just for info, the later Prolific drivers disable this chip so I force Windows 10 to use the 3.3.2.102 driver.

author: AndyC_772
author_rank: Super Contributor
timestamp: March 26, 2018, 07:28:52 pm
content: I struggled to get my 2015 to talk over RS232. Turned out that its internal MAX232 (or similar device - I forget the exact part number) was fried.It was an easy repair, of course. It may do no harm to pop the lid off and probe it with a scope just to be sure it's working OK.

author: cellularmitosis
author_rank: Unknown
timestamp: March 26, 2018, 08:09:38 pm
content: Quote from: AndyC_772 on March 26, 2018, 07:28:52 pmThanks, I think I encountered at least one post mentioning this while doing some searching, which is what made me consider the possibility of a hardware fault!

author: cellularmitosis
author_rank: Unknown
timestamp: March 27, 2018, 06:25:27 am
content: IT VERKS!!!I tried a different serial-USB cable (the one I typically use with a 34401A), and tried the sample program you mentioned in the manual and it works.I guess my other serial-USB adapter is one of the non-compliant ones. I don't know why I didn't think to just steal the known-good cable off the the 34401A for a simple test!Code:#!/usr/bin/env pythonimport sysimport serialser = serial.Serial(port = sys.argv, # e.g. /dev/ttyACM0 or /dev/ttyUSB0baudrate = 9600,bytesize=serial.EIGHTBITS,stopbits = serial.STOPBITS_ONE,parity = serial.PARITY_NONE,timeout = 10)commands = ["*RST",":INITiate:CONTinuous OFF;:ABORt","SENSe:FUNCtion 'VOLTage:DC'",":SENSe:VOLTage:DC:RANGe 10",":SENSe:VOLTage:DC:NPLC 0.01",":DISPlay:ENABle OFF;",":SYSTem:AZERo:STATe OFF",":SENSe:VOLTage:DC:AVERage:STATe OFF",":TRIGger:COUNt 1",":READ?"]for c in commands:ser.write(c + "\n")sys.stdout.write(ser.readline())sys.stdout.flush()it spits out:Code:-2.07660616E-01Thanks so much for the pointers guys!