Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Serial Read timeout errors

I am using LabView to control a Keithley 2400 Sourcemeter on an RS-232 Interface. I can use the VISA commands to send information to the instrument perfectly, but every time I try to read from the device I get a timeout erro (-1073807339). I have read the post concerning this specific error and followed its advice, but nothing to no avail.
Here what I know:
It's not the serial port (loopback test and port monitors confirm that)
I am using the latest version of drivers for the instrument.
I have used property nodes to enable a termination character and to set it as a line feed. The device is also configured to recognize LF as a TERMCHAR.

And whenever I use the property "Read Bytes at Serial Port" it returns a zero count, even when
I know that's incorrect

Any suggestions would be very helpful. Thank you.
0 Kudos
Message 1 of 7
(3,761 Views)
I haven't used this particular instrument, but I have a thought...

I'm wondering if maybe the meter is stuck waiting for handshaking, but for some reason it isn't being told that it's clear to send data.

Could it be that the meter is configured for hardware handshaking, and LabVIEW is not? Or perhaps the serial cable isn't passing through the handshaking lines?

So, you might check the instrument handshaking configuration, and test your serial cable's handshaking lines.

Report back if you figure anything out.

Brian
0 Kudos
Message 2 of 7
(3,761 Views)
I am not sure what driver for the instrument you are using, but there is a LabVIEW GPIB instrument driver for your instrument (written by the instrument manufacturer; see details at the site below) located at: http://zone.ni.com/idnet97.nsf/9b2b33e1993d877786256436006ec498/966189a0e0d39bed86256d8a0068b2c8?OpenDocument

If you have GPIB hardware you may consider this. Otherwise I would first test a simple program by sending a known command for which your instrument will respond using a VISA Open (or VISA Configure Serial Port.vi), Write, Read, and Close in series.
Best,
JLS
Sixclear
0 Kudos
Message 3 of 7
(3,761 Views)
The handshaking was a good idea. I tried it, but it didn't work. The device only uses XON/XOFF flow control; hardware flow control is not an option. I reset the device, my VI, and my computer to use XON/XOFF. No dice.
As far as testing the cable, I was unable to do that yet (my leads are missing). If I find anything there, I'll let you know.
I've included a copy of a VI that I've been using to control the 2400. It should work if you send the copmmand"*IDN?" If you or anyone else wants to take a look at it and see if there are any obvious mistakes, I'd appreciate it.

Thank yor for your help.
0 Kudos
Message 4 of 7
(3,761 Views)
The 2400 does have a GPIB interface, and it works flawlessly. Unfortunately, we have too many devices on one bus, and cabling length causes erratic operation. Since the other devices don't have other interace options, I had to move the 2400 to serial. I really wish I could just go GPIB with the thing.

I checked out the link (thank you for that, btw), but it seems I already have that driver set.

As far as a simple VI, I posted a link to one that I've been using in my reply to a previous suggestion. Feel free to look at it and tell me if I'm missing anything.

Thank you.
0 Kudos
Message 5 of 7
(3,761 Views)
I just tested your VI on a Fluke 45 (since I don't have a Keithley 2400), and it worked fine.

I assume that the Keithley really does use Carriage Return as a termination character. You might also try decimal 10 for linefeed.

Brian
0 Kudos
Message 6 of 7
(3,761 Views)
Thank you so much for testing the VI. I'm glad to see that it's generic enough to work across devices. The 2400 uses either CR, LF, or CR+LF as a term char. I have tried all of these combinations previously, and gotten no results. I've also used the decimal values for both characters (10 and 13 I believe), but no luck there either. It's a head scratcher, that's certain. But I really appreciate the input.
0 Kudos
Message 7 of 7
(3,761 Views)