LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting the Sourcemeter Keithley 2602 with LabView

Hi
I am currently trying to control a Sourcemeter Keithley 2602 using a serial link and Labview 7.1, and I have some troubles.
I wish to use a script, as it is the most flexible way to communicate with the 2602. Then, using Keithley TestScript Builder, this script works fine:
 
smua.reset()
smua.source.limiti = 10e-3
SweepVLinMeasureI(smua, 1, 20, 0.1, 20)
smua.source.output = smua.OUTPUT_ON
waitcomplete()
smua.source.output = smua.OUTPUT_OFF
printbuffer(1, 20, smua.nvbuffer1.readings)
 
and I get my 20 readings back on the console
 
Then, I wish to use LabView to control the 2602. Documentation shows (2602 User's Manual, p. 3-15) how to use LabView and script.  But it does not work (see my2602_Script.vi). As far as I can tell with NI-Spy, Visa session opened, Command are written to VISA-Resource, but the script is never executed.
 
Then again, I try to use the sub-Vi's that come with the Keithley 2602 driver (see my2602_Sweep.vi). This time, the sweep is executed, but my Labview code ends before the end of the sweep. I cannot find the sub-vi equivalent to the "waitcomplete()" instruction.
 
Does anyone have experienced this kind of troubles ?
Thanks in advance
Nicolas
Download All
0 Kudos
Message 1 of 5
(5,215 Views)

I don't see a real mistake in your program but my experence is also 2 days old.
maybe you should not use printbuffer, you should use the same program as in the tlb.
maybe there is nothing in the buffer so nothing is printed.
normally printing goes to the controlling device, this should be the communication line.

I don't like the way keithley programs the driver but this one should work.
did you see the operating light go on and off again?

did you connect an oscilloscope to see what happens on your power output, no error messages?

 

greetings from the Netherlands
0 Kudos
Message 2 of 5
(5,202 Views)
In fact, it seems it is more a VISA problem than a Scripting problem.
See my2602_VISA.vi

It is such a simple vi, but still it does not work. But, when I open a VISA session with MAX, and send the beep command, I can hear it!
Is there a problem with my write operation ? I am using a RS-232 link, can this be a source of trouble ?
0 Kudos
Message 3 of 5
(5,199 Views)

Hi

 

Youre problem comes from the missing end character linefeed.

try these for downloading a script.

I only tried via the gpib bus, but serial should also work.

 

greetings from the Netherlands
0 Kudos
Message 4 of 5
(5,190 Views)
Hi Albert,

I was off for a few days, sorry for the delay. I'll try your vi's as soon as possible.
Thanks a lot.

nicolas
0 Kudos
Message 5 of 5
(5,171 Views)