Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting an output for each new measurment from Keithley 2400

Hi everyone,

 

I am working on a project where I am using a Keithley 2400 Sourcemeter (GPIB HS USB connection) to measure surface conductivity of a specific material. I have a fixed delay number (say 1000 ms) between each measurement (I am using LabTracer 2.0). For the purpose of my project I have to measure the conductivity on three different points on the surface of the specimen. In order to achieve that I am using an Arduino microcontroller which controls the circuit’s endings – three resistors on different places on the surface of the material. The Arduino board starts the process when it is being triggered by the Keithley (when the current flow starts – utilizing analogRead() )

My problem is that the delay time of Keithley is not exactly 1000 ms, and this causes out of sync phenomena.

An ideal solution to this would be if I could get an output in real-time each time a new measurement is taken by the Keithley. In that way I could use this output as a reference to whether open or close the circuit. The analogRead command is useful for the start of the circuit, as it gives an output when the current flow starts. Ideally I would like to receive another output for each new measurement.

 

The way I am thinking the whole process is this:

 

Initialization of the circuit by setting resistor_1 to OPEN

Start Keithley

Take measurement

CLOSE resistor_1

OPEN resistor_2

If new measurement is taken then:

CLOSE resistor_2

OPEN resistor_3

If new measurement is taken then:

CLOSE resistor_3

OPEN resistor_1

etc…

 

Any suggestions on that would be much appreciated. Thanks in advance!

0 Kudos
Message 1 of 6
(2,012 Views)

Hi

What is the Arduino doing?

What is your measurement vi?

 

Please send the measurement vi to this board, just attach it.

And explain a bit about your software.

Why not wait for the Keithley result to enter and then ask the Arduino to measure.

Or even better, why not measure with the keithley.

greetings from the Netherlands
0 Kudos
Message 2 of 6
(1,991 Views)

Hi. Thanks for your reply.

 

I am using LabTracer 2.0 for setting up the Keithley. Could you please guide me on how can I retrieve the measurement's vi? I am a total beginner on this and I have no clue on how to find this file. I guess everything is set to default as I don't know how to change any parameters of the measurement. The only parameters I am changing are the voltage (I keep the voltage constant - from 5V to 5V), the number of points, the delay time between each point and the compliance (also constant).

 

The Arduino is just turns on and off three relays sequentially (each of them is connected to a different resistor). In that way it gives access to only one resistor at the time where Keithley can take a measure from.

 

The problem is on the delay times of Keithley and Arduino. I have set Arduino to keep each relay open for 1000 ms, the same delay time between two measurements by the Keithley. At the beggining of the process everything seems to be working great. But a few seconds later Keithley measurements seems to be happening not exactly at 1000ms, but a bit after that. As the process goes on this time lag is getting bigger and bigger. Eventually the result is that at some point, Keithley will take a measure from a different resistor from the one it supposed to take.

 

I also used NI Spy software to capture the actual delay times of the Keithley. It seems that they are not exactly 1000ms (as expected) but ~1016ms or ~1031ms(this is also not constant, so I cant set arduino's delay accordingly). If there is a way to set the delay to exactly 1000ms, I think this would solve my problem.

 

If this is not possible, I guess I have to link somehow keithley and arduino. Either set the arduino to alter from one relay to the other every time keithley takes a new measure, or force keithley to take a new measure every time arduino turns off a relay and turns on a new one (these two happens simultaneously).

 

I hope I explained this in a understandable way. I will provide anything else that could help in solving this.

Thank you!

0 Kudos
Message 3 of 6
(1,970 Views)
Hi
Handshaking between Arduino and Keithley is sure a good thing.
Accepting that cmds to the Arduino are executed within say 10..100 ms you can start the Keithley measurement immediately after that.
After the Keithley has returned the measurement you can send the next cmd to the Arduino and immediately after that send the measurement cmd to the Keithley again.
 
Can you send your measurement vi's (in zipped form) to the forum?
In this forum you are always welcome to learn how to program in a data flow language (G aka LabVIEW).
It has some nice properties different from text based languages that you can use here.
 
greetings from the Netherlands
0 Kudos
Message 4 of 6
(1,964 Views)

The Keithley 2400 is very sophisticated.  It has an internal timer which will give you measurements at much higher precision than you quote, so there's an issue with how you are doing the measurements.  I suspect your LabTracer software is scheduling the measurement, based on the PC clock.  How long does this measurement run?  The software is probably getting bogged down updating data files and plots which are causing the inaccuracies.  Can you make us a sketch of how things are controlled?  What synchronizes the LabTracer software with the Keithley and Ardhuino?

 

As Albert mentioned this is the NI instrument control forum, not Keithley or Arduino.  We generally use NI LabVIEW to solve these sorts of software/hardware synchronization problems.  Personally, I would write all the software in LabVIEW to control both communication with the Keithley an the Arduino.  (Which can be done in many other languages as Albert mentions.  NI would probably like me to mention you could do this with one of their USB-DAQs and replace the Keithley and Arduino all together!)

 

So without all the specifics of how you are running things, and without knowing LabTracer,  here's some advice..

- Look at replacing LabTacer with something like LabVIEW to control both Arduino and Keithley.

- Look at how to setup the Keithley's internal timer to take measurements at exactly 1000ms.

- Look at the Keithley's internal memory functions, you can store 2500 I-V readings at a time.  Perhaps perform all readings then read back all points,

- Look into synchronizing the Arduino and Keithely measurements, using a trigger pulse.  I think your Arduino could do that, send 5V TTL, but then you still need software to read the Keithley.

 

0 Kudos
Message 5 of 6
(1,939 Views)

Thank you for your response. I will sure look into LabView software as it seems that it provides much more control of the operations. I will definitely come back with a new post as I am going to need some assistance.

 

Thanks again for your responses!

0 Kudos
Message 6 of 6
(1,928 Views)