Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I set a source current and measure the voltage at given time intervals using GPIB on a Keithley 2410 (LabView 7.1)?

Solved!
Go to solution

Hi,

I am using an old version of LabView, 7.1, and a Keithley 2410 communicating through GPIB.

I want to make a simple program, sending a commando to the 2410 to source a given current, continuously.

Then at given time intervals, I want to read the current voltage for logging in a txt file. My Idea is to do this

simply by sending strings of commands to the Keithley 2410. Could anyone please give me a hint in the right

direction of doing this?

 

I am not very good at LabView, but have made some simple programs using USB-DAQ's before.

 

All help is appreciated. Smiley Tongue

 

--

Lars

0 Kudos
Message 1 of 19
(26,889 Views)

Hello Lars,

 

I've recently done some labview programming (version 8.6) for GPIB communication with a keithley 2400 series source meter.  The following link will direct you to the Quick Start Guide and User's Manual.  These documents give you very good information regarding the commands, as well as some very specific examples (basic source - measure or more advanced settings like logrithmic sweeps).

 

http://www.keithley.com/products/dcac/voltagesource/broadpurpose/?path=2400/Documents#6

 

Note that the lower case letters of commands are optional.

:SOURce:FUNCtion:CURRent       tell the meter to source current

 

:SOURce:CURRent:MODE:FIXed       and :SOUR:CURR:MODE:FIX      are the same thing

This specifies that you wish to source a constant current

 

then,     :SOURce:CURRent:LEVel 1        will set the fixed current value to 1 Amp

 

:OUTPut ON           Start Output

 

Look at page 3-19 of the User's Manual for a specific example on source voltage - measure current.   Your case would just be the opposite.

 

In regards to measuring at regular time intervals, you can just use a wait vi block within a for-loop to create the correct time between measurements.

 

Place all of the measurements into an array, using a shift register on the for-loop, and finally write to the txt file after all measurements are complete.

Message 2 of 19
(26,880 Views)

Thanks for great help.

 

I still have some trouble with this. I have made a small vi to set up the 2410, turn it on, read the voltage and then turn it off (see figure),

but it seems not to read the voltage, as 'data'-string returns empty. Also the 2410 does not turn off. If I remove the READ? command from the vi, it turns on and of again just fine.

 

Any comments on the vi would be appreachated. Smiley Indifferent

 

--

Lars

0 Kudos
Message 3 of 19
(26,855 Views)

Hi Lars,

 

I'm not sure why you are receiving an empty string, as it seems you are setting up the SENS commands properly.  One thing I would recommend is to replace all of the individual strings with larger string constants.  Each command only needs to be separated by a carraige return, the semi-colon is not necessary.  I can't say for sure why you are not getting a response with "READ?" as I used TRAC:DATA? for my application to read-out a large number of measurements stored in the buffer.  You might want to try adding a delay between OUTP ON and READ?.  It's possible that the READ? command is arriving too early.

 

Another possibility is that your GPIB READ block is not terminating and the device is stuck in TALK MODE, or at least this is my interpretation of this problem.  Set the number of bytes to 255 and set the mode to 2.  This will set the GPIB READ to terminate on a line feed character or 255 bytes (we are more interested in the line feed character).  This could be the reason that your device is not responding to the OUTP OFF command.

 

On a side note, I would recommend sending *CLS after reading the data.  This will clear the event  and error register, setting a clean slate for the next measurement.  While this is probably not necessary since you are just reading a single value, it's a good idea to always reset the state of the device.

Message 4 of 19
(26,844 Views)

Sorry that they keep placing smiley faces where I'm trying to write the code.  The one in the previous post was supposed to be TRAC and DATA? separated by a colon.

0 Kudos
Message 5 of 19
(26,843 Views)
Solution
Accepted by ltvedt

Thanks again for your help,

 

I figured out that the reason why I did not get any data (and that the 2410 froze/hung) was that in the GPIB READ vi, I did not state the byte count to be read, and this did not have a default value.

After adding a constant to this input, everything worked as a charm. Smiley Very Happy

 

Also thanks for your recommendation about the *CLS command.

 

--

Lars

Message 6 of 19
(26,834 Views)

Hello, 

 

I am using Labview 2011. I am trying to build a model to measure an voltage and source current in 2400. I do not understand on how to make 2400 to source current by using labview. Do you have a sample program in which I can understand this better?

 

Thanks,

-Hema   

0 Kudos
Message 7 of 19
(26,215 Views)

did you download the driver from the NI website?

as far as I know a driver is added.

greetings from the Netherlands
Message 8 of 19
(26,210 Views)

The Kiethley 2400 manual (easy to find on their website) has detailed explanations of every command you can send along with programming examples (source measure examples are included).  Commands to source, sense, create sweeps, store, report are all listed and most are used in examples.

 

 The files i've attached here set the keithley to sweep current over a specified range, measure both voltage and current and store the values in a buffer.  The SRQ wait vi loops until the Keithley is ready to report the data.  Finally, Trace : Data? reads the stored information from the keithley buffer.

 

This is a very specific example taken from code that I use.  Use the 2400 Manual to change the code as you need.

Message 9 of 19
(26,207 Views)

Hello Albert, 

 

Thank you for the quick reply. I am able to communicate with the device but I am not able to collect data (i.e source current and measure voltage) from it. So you still think I it might be a problem with the driver? Also when I checked NI for Keithley 2400 drivers the latest one it had was for labview 2010. I have attached my model here. I made some changes from an example I found online. I dont really understand what values its reading. I have just started to explore labview. Please let me know whats going wrong with this. 

 

Thanks, 

Hema

0 Kudos
Message 10 of 19
(26,207 Views)