From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 Keithley 2420 labview error

Hello,

 

I was hoping someone might be able to help me interface a Keithley 2420 with labview 2013 via RS232.

 

I have installed the driver details through labview, and they were successfully installed. However, when I try to run one of the examples provided (ReadSingle for example), the operation time-out and I am presented with the error message attached. This happens even if I extend the timeout period. I have checked that the Baud rate etc match on both sides.

 

In addition to this the Keithley occassionally flashes the error code -101, invalid character, which may or may not be related to the problem.

 

Has anyone else had a similar problem, and found a solution?

 

 

 

 

0 Kudos
Message 1 of 10
(5,381 Views)
That is not a timeout error. It indicates that you have another program open and accessing the port. Windows does not permit that. The other program could be MAX or a terminal emulation program.

If you do run MAX or a terminal emulation program, do you get anything with a simple id query?
Message 2 of 10
(5,373 Views)

Thanks for the speedy reply.

 

I made sure that all other programs that might be using the port were shut (including MAX).

When I send the *IDN?\n Query the return is 'KEITHLEY INSTRUMENTS INC.,MODEL 2420,1131437,C30   Mar 17 2006
09:29:29/A02  /H/J\r', but also kicks up:

 

Read Operation
Error

VISA:  (Hex 0xBFFF0015) Timeout expired before operation completed.

 

 

 

 

0 Kudos
Message 3 of 10
(5,368 Views)

Looking at a previous post I decided to check the termination char. When I changed the termination char to <CR+LF> on the Keithley the MAX error message disappears, returning normally. When I try to run the ReadSingle VI the keithley beeps and outputs the single measurment, but also starts to repeatedly flash the -101 error code (and buzzer). The Read Multiple also returns values normally.

 

Is the error code on the keithley a cause for concern?

 

 

0 Kudos
Message 4 of 10
(5,365 Views)

HI charliehorse,

 

I'm unfamiliar with your instrument, but as you are using GPIB I'm lead to believe there may not be the need to use a termination char:

 

http://www.ni.com/tutorial/4256/en/

 

Perhaps the use of one where it may not be needed could be problematic?

 

Ingram

0 Kudos
Message 5 of 10
(5,317 Views)

Hi

 

can you publish your vi (vi's can be attached) and the exact errormessage as you did the first time?

greetings from the Netherlands
0 Kudos
Message 6 of 10
(5,309 Views)

I had to change the termination char to <CR + LF> on the Keithley to get it to talk to Labview. MAX gives no further errors on the ID query, but the Keithley still complains with the error message in the attached figure. VI attached. This is just the readsingle.vi provided by Keithley with the addition of the loop and write to file. Let me know if you need any further details.

 

Download All
0 Kudos
Message 7 of 10
(5,291 Views)

It seems that the error message only persists when I am not runing the VI. With the VI running everything seems to work ok. It's just not clear why the error message persists when I'm not taking measurements. Weird!

0 Kudos
Message 8 of 10
(5,281 Views)

The driver is likely flawed.  The default term character is \n or 0x0A  the kiethly defaults to a CR or \r 0x0D

 

Change that back on the device (and power cycle it- or it won't really change) then edit the init to look for 0x0D


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 10
(5,270 Views)

Thanks. I will try what you suggest. Attached is the initialisation VI. Are you able to tell me how I should change this to look for 0x0D?

 

 

0 Kudos
Message 10 of 10
(5,238 Views)