Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Keithley 2602 communication with LabVIEW (RS-232)

Hi,

I am trying to control a Keithley 2602 Sourcemeter using LabVIEW v.8.2, however I am having trouble getting them to communicate. I am fairly new at LabVIEW and have not found the user manuals to be of much help since they specify that the process for this step is different depending on the equipment you are trying to connect to. I have downloaded the Keithley drivers from here: http://www.keithley.com/support/data?asset=51950 as per the advice on previous forum posts.

 

Then I unzipped the file and copied its contents into C:\Program Files\National Instruments\LabVIEW 8.0\instr.lib\

(I assume this is how you install the drivers, however is there more to it?.. there are no instructions with the driver)

 

Next I connected the sourcemeter to my computer using an RS-232 cable and turned it on. Then I opened NI MAX and went to Devices and Interfaces -> Ports (Serial & Parallel) -> COM1. The device status message here says that the "device is working properly".

 

Then I opened up one of the example files (KE26XX Config Source & Measure) included with the drivers to see if I can run it successfully. When I select COM1 and try to run it, i get the error "VISA Open in Keithley 2600 Series/lvlib:Initialize.vs->KE26XX Config Source & Measure.vi" and an error code -1073807246 (which I looked up to be VI_ERROR_RSRC_BUSY     The resource is valid, but VISA cannot currently access it.)

 

The user manual also mentions that configure the VISA device in NI MAX and refer to assigning aliases, however I do not know where or how to do this (maybe in the VISA test panel?). Do I need to somehow configure the sourcemeter before I can use it in a LabVIEW program?

 

Ultimatly I would like to use Labview to control the keithley sourcemeter and also another device (a multiplexer) to switch between multiple devices, however for now I would be very greatful for any advice on how to get the Keithley 2602 sourcemeter to communicate with LabVIEW and successfully run one of their test programs. Also, any specific details or steps would be of great help as I am new to this program and am not too familiar with everything.

 

Please let me know if I am missing any crucial information and thanks for your help!

Jason

 

0 Kudos
Message 1 of 20
(7,390 Views)

Since the os prevents more than a single process to connect to a serial port, make sure you don't have any other programs open. That includes MAX.

0 Kudos
Message 2 of 20
(7,386 Views)

Thanks for your reply, I closed MAX and tried to run the example again, and got a new error code:

-1073807339, which corresponds to: VI_Error_TMO,  Timeout expired before operation completed.

 

Is there normally anything else I need to do to get them to communicate with each other?

 

Jason

     
0 Kudos
Message 3 of 20
(7,373 Views)

Verify that the com settings (baud rate, parity, etc.) match at both ends and that you have the correct cable type (null-modem or straight-through).

0 Kudos
Message 4 of 20
(7,368 Views)

Hi again,

I have checked both of the above mentioned and the com settings all match (device manager settings, the settings set in the keithley instrument, and the settings in MAX). Also, the cable is straight-through.

 

Thanks again for your suggestions

0 Kudos
Message 5 of 20
(7,307 Views)

The device manager and MAX settings are actually irrelevant since the initialize function sets up the pc.

 

The function also sets the termination character so that is something else you could verify. Have you tried a terminal emulation program such as Hyperterminal, Procomm, or Tera Term?

Message 6 of 20
(7,290 Views)

Hi, I updated the firmware and tried running an example program not provided by Keithley and it was able to communicate. I think that the problem is that the initialization VI for the Keithley examples always seems reset the settings back to 7 bits whenever I run the program, and therefore I would always get an error since I was using 8 bits. I mistook this for the instruments failing to communicate. After confirming that this, I changed all the settings to 7 bit to match the initialization VI and everything works great now. 

 

Thanks for all your help!

Jason

0 Kudos
Message 7 of 20
(7,273 Views)

The number of data bits can be set on the initialize function and as I mentioned, you have to ignore what MAX is set to. A quick glance at the front panel would have shown the default VI settings. In the long run, it does not matter whether you change the VI or the instrument.

0 Kudos
Message 8 of 20
(7,270 Views)

Hi I m new to Labview as well, may I ask whats 7and 8 bits you are talking about? how to choose the right bit?

0 Kudos
Message 9 of 20
(5,971 Views)
It has nothing at all to do with LabVIE bitW. It is all about character encoding of RS232. http://en.m.wikipedia.org/wiki/RS-232.

As long as the bit count is the same at both, you should be okay but just set to what of recommended in the manual.
0 Kudos
Message 10 of 20
(5,967 Views)