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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling a Keithley 6612A

Hello everyone,

 

I am trying to control a Keithley 2612A in order to use it as a current source. I know how to control it "manually" from its physical interface, but so far I am unable to replicate this with LabView. I have downloaded the VIs project at http://sine.ni.com/apps/utf8/niid_web_display.model_page?p_model_id=17136, none of which work out of the box.

I use a GPIB connection between the PC and the Keithley, and I can see that it appears as listed in NI MAX software. When I VISA test it, query returns

1: Write Operation (*IDN?\n)

Return Count: 6 bytes

2: Read Operation
Return Count: 54 bytes
Keithley\sInstruments\sInc.,\sModel\s2612,\s1118695,\s1.2.0\n

 

which seems to point out that it may be working. However, clicking on "Read" yields

 

Read Operation
Error

VISA: (Hex 0xBFFF0015) Le délai d'attente (timeout) a expiré avant que l'opération ne soit achevée.

 

I have already checked in the communication manual that there should be an end of line character, which I enabled (but I cannot save this option, for the button is greyed out). (https://download.tek.com/manual/2600AS-901-01--E-Aug2011--Ref.pdf)

 

Read Status Byte returns

 

Read STB Operation
No Error

 

I then followed one of the examples provided in the above link, but I modified the code to

 

smua.measure.rel.leveli = 0,0000001
print(smua.nvbuffer1.readings[10])

 

in order to set a current of amplitude 1e-7 A. To no avail. I got a plethora of different errors. The latest one is

 

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

 

I attach the file that produces this error and the one I wish to debug.

Any pointed is greatly appreciated!

 

0 Kudos
Message 1 of 14
(1,980 Views)

It looks like it is connected fine. When you run a "query" from the test panel it's like a write + read all together. So when you click read again, there are no more bytes to read, this is not a communication error.

 

Assuming your commands are all correct, I would guess the problem could be using a comma "," as the decimal separator instead of a period, can the instrument handle that?

 

There is a VI under the "config" category called "Configure Source (level).vi", I would start there and see if you can set a current with it.

 

0 Kudos
Message 2 of 14
(1,926 Views)

Ok, thanks a lot for the explanation!

Strangely, when I type the dot, it auto converts it to a comma. I just tried to copy and paste a dot, and it stays a dot. But this doesn't change anything, in that the error message is still there and is the same.

I have just ran the "Configure Source (Level).vi" in debug mode, and no error is returned. However I cannot see anything on the physical display of the apparatus, and measuring the voltage across a resistor with a voltmeter shows 0 V despite that I set both a non zero current and a non zero voltage (but picked the current mode). So, it doesn't seem to work, and it doesn't return any error in that case.

 

Not sure where to go from here.

 

Edit: I have just tried the Read Voltage (linear current sweep).vi and it works. So, I am guessing the problem arises from the syntax of the command I use.

0 Kudos
Message 3 of 14
(1,885 Views)

Hi bug,

 


@unspotted_bug wrote:

Strangely, when I type the dot, it auto converts it to a comma. I just tried to copy and paste a dot, and it stays a dot. But this doesn't change anything, in that the error message is still there and is the same.


You cannot change the comma to a dot in a numeric control, when LabVIEW/your OS is set to use the comma as decimal separator!

 

Either switch the whole OS (System settings) to use the dot (my preferred way) or switch LabVIEW to use the dot (other people's recommendation) as decimal separator. Then the string handling (formatting/parsing) inside the device driver will be able to handle the English numeric format used by your DAQ device…

 


@unspotted_bug wrote:

So, I am guessing the problem arises from the syntax of the command I use.


Yes, that's what we guess, too!

This especially may occur when you try to set small values (like "0.01") for current: your LabVIEW/OS creates a string like "0,01" instead and the device only understands the numeric data before the comma - resulting a an value of "0" for the current output…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 14
(1,879 Views)

That's odd. I just tried typing "shift + ;" (it's a way to write a dot with the French keyboard), and a dot appears. However when I use the numpad and press the dot key, a comma appears. I have settled to use the dot for now. And anyway, even if Labview handles this as 0, it should still perform a measurement and not return an error. But that's not what happens with my code.

 

I have tried the linear current sweep code, and it successfully reads the voltage. However the current is pulsed, which is something I wish to avoid, I would prefer to gradually increase the current rather than resetting it to 0 between each measurement. I have checked the vi's and it doesn't seem straightforward to me how to accomplish this task. For example in the file "Read voltage (current list sweep).vi", it seems like the code feeds a list of strings containing the array of the chosen currents to a write Visa node. Then, a flat sequence that contains only a wait time follows. It is not clear at all to me why this flat sequence would iterate over the indices of the currents in the list of currents, but that's what it apparently does.

So, I do not see how to modify this vi in order to smooth the transition between each current in the list.

0 Kudos
Message 5 of 14
(1,873 Views)

Hi bug,

 

please do this:

  1. Stop and exit LabVIEW.
  2. Switch the regional settings to use the dot as decimal separator.
  3. Start LabVIEW and load your current project.
  4. Try to run your VI(s) again: Does the Keithley device answer as expected now?

You might also debug the device driver VIs and check/examine the strings which are sent to/received from the device.

 

(I experienced similar problems with (unmodified) Keithley device drivers: they simply don't handle other regional settings then "English dot". Some functions/VIs might work, others will fail with errors either by the Keithley device or errors in the VI…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 14
(1,868 Views)

Thanks for the tip, GerdW.

Same error message.

At this point it isn't too bad since I can still somehow control the apparatus using a provided vi. I just haven't figured out how to maintain the current instead of resetting it to 0 A between two different currents. That's a big problem, but at least I can control the apparatus.

0 Kudos
Message 7 of 14
(1,863 Views)

Hmm, this is confusing to me. Even the program that I thought was working yields the error

 

Keithley 2600 Series.lvlib:Error Query.vi<ERR>
Instrument reports:
-2.85000e+02 TSP Syntax error at line 1: unexpected symbol near `2' 2.00000e+01 1.00000e+00
0.00000e+00 Queue Is Empty 0.00000e+00 0.00000e+00

 

<b>Complete call chain:</b>
Keithley 2600 Series.lvlib:Error Query.vi
Keithley 2600 Series.lvlib:Print Buffer Data.vi
I_vs_V_example_NI_forum_3.vi

 

It looks like it is a dot/comma thing after all. I changed the decimal symbol in Windows settings to the "." sign, to no avail. Same error, regardless of the settings.

0 Kudos
Message 8 of 14
(1,848 Views)

I am completely puzzled. The error keeps changing between runs, while I do not change anything!

 

Here is an error:

Scan From String (arg 1) in Keithley 2600 Series.lvlib:Error Query.vi->Keithley 2600 Series.lvlib:Print Buffer Data.vi->Read Voltage (List Current Sweep)_test.vi

 

Reruning the program yields:

Keithley 2600 Series.lvlib:Print Buffer Data.vi<ERR>
Reading buffer end index is invalid.


<b>Complete call chain:</b>
Keithley 2600 Series.lvlib:Print Buffer Data.vi
Read Voltage (List Current Sweep)_test.vi

 

Reruning once more yields:

 

Keithley 2600 Series.lvlib:Error Query.vi<ERR>
Instrument reports:
-1.04000e+02 Data Type
-1.04000e+02 Data Type
-1.04000e+02 Data Type
-1.04000e+02 Data Type
0.00000e+00 Queue Is Emp

 

<b>Complete call chain:</b>
Keithley 2600 Series.lvlib:Error Query.vi
Read Voltage (List Current Sweep)_test.vi

 

Reruning it again yields either one of the above message, except that sometimes the numbers are different.

 

Attached is the file that produces these errors.

 

Aside from trying to fix those extremely weird errors, I am trying to figure out how to perform a DC current sweep instead of a pulsed one, as shown in page 138 of https://download.tek.com/manual/2600AS-901-01--E-Aug2011--Ref.pdf

To no avail so far, I do not see where in the provided vi's the command to use a pulse is used. I would modify it if I could find it...

0 Kudos
Message 9 of 14
(1,830 Views)

Hi bug,

 

I cannot open your VI as I'm limited to LV2017 right now…

 


@unspotted_bug wrote:

Aside from trying to fix those extremely weird errors, I am trying to figure out how to perform a DC current sweep instead of a pulsed one, as shown in page 138 of https://download.tek.com/manual/2600AS-901-01--E-Aug2011--Ref.pdf


The manual says (on page 140):

Seems rather simple to me…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 14
(1,826 Views)