Author Topic: Keithley 2015 RS-232 woes  (Read 2399 times)

0 Members and 1 Guest are viewing this topic.

Offline cellularmitosisTopic starter

  • Supporter
  • ****
  • Posts: 1111
  • Country: us
Keithley 2015 RS-232 woes
« on: March 25, 2018, 10:35:46 pm »
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?

LTZs: KX FX MX CX PX Frank A9 QX
 

Offline Ash

  • Regular Contributor
  • *
  • Posts: 161
  • Country: au
Re: Keithley 2015 RS-232 woes
« Reply #1 on: March 26, 2018, 01:03:16 am »
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.
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11561
  • Country: ch
Re: Keithley 2015 RS-232 woes
« Reply #2 on: March 26, 2018, 12:42:12 pm »
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?
What 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.
 

Offline jpb

  • Super Contributor
  • ***
  • Posts: 1771
  • Country: gb
Re: Keithley 2015 RS-232 woes
« Reply #3 on: March 26, 2018, 05:48:43 pm »
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 command
e.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
« Last Edit: March 26, 2018, 05:55:18 pm by jpb »
 

Offline cellularmitosisTopic starter

  • Supporter
  • ****
  • Posts: 1111
  • Country: us
Re: Keithley 2015 RS-232 woes
« Reply #4 on: March 26, 2018, 06:09:16 pm »
Thanks guys!  I'll take a closer look at all of these suggestions this evening.
LTZs: KX FX MX CX PX Frank A9 QX
 

Offline Macbeth

  • Super Contributor
  • ***
  • Posts: 2571
  • Country: gb
Re: Keithley 2015 RS-232 woes
« Reply #5 on: March 26, 2018, 07:22:48 pm »
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.
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4228
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Keithley 2015 RS-232 woes
« Reply #6 on: March 26, 2018, 07:28:52 pm »
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.
 
The following users thanked this post: cellularmitosis

Offline cellularmitosisTopic starter

  • Supporter
  • ****
  • Posts: 1111
  • Country: us
Re: Keithley 2015 RS-232 woes
« Reply #7 on: March 26, 2018, 08:09:38 pm »
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.

Thanks, 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!
LTZs: KX FX MX CX PX Frank A9 QX
 

Offline cellularmitosisTopic starter

  • Supporter
  • ****
  • Posts: 1111
  • Country: us
Re: Keithley 2015 RS-232 woes
« Reply #8 on: March 27, 2018, 06:25:27 am »
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: [Select]
#!/usr/bin/env python

import sys
import serial

ser = serial.Serial(
    port = sys.argv[1], # e.g. /dev/ttyACM0 or /dev/ttyUSB0
    baudrate = 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: [Select]
-2.07660616E-01

Thanks so much for the pointers guys!
LTZs: KX FX MX CX PX Frank A9 QX
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf