Tektronix Technical Forums are maintained by community involvement. Feel free to post questions or respond to questions by other members. Should you require a time-sensitive answer, please contact your local Tektronix support center here.

Trouble creating a buffer (error -286)

Models 2601, 2602, 2611, 2612, 2635, 2636
Models 2601A, 2602A, 2611A, 2612A, 2635A, 2636A
Models 2601B, 2602B, 2604B, 2611B, 2612B, 2614B, 2634B, 2635B, 2636B
Post Reply
rmtoja
Posts: 9
Joined: November 18th, 2016, 7:13 am
Country: Argentina
Contact:

Trouble creating a buffer (error -286)

Post by rmtoja » November 18th, 2016, 7:57 am

Hi!

I'm trying to runa script loaded from the USB drive (SMU model 2612B, firmware version 3.0.4), and I want to create a buffer to store more data points than those available on non-volatile buffers. However I can't get it working. The code I'm using is:

Code: Select all

-- Restore Series 2600B defaults.
smua.reset()
-- Set compliance to 200 V.
smua.source.limitv = 200
-- Crear buffer con 200k casilleros, y que no junte los timestamps ni los valores de la fuente (porque
-- los fijamos en 1 mA)
mybuffer1 = smua.makebuffer(200000)
smua.mybuffer1.collecttimestamps = 0
smua.mybuffer1.collectsourcevalues = 0
-- Pulse current sweep, 0 mA bias, 5 mA level, 1 ms pulse on, 9 ms pulse off (duty cycle 10%),
-- 100000 cycles (time ON total = 100 s).
PulseIMeasureV(smua, 0, 5e-3, 1e-3, 9e-3, 100000)
printbuffer(1, 100000, mybuffer1)
-- Guardar el buffer de datos en el pendrive, en formato csv
savebuffer(mybuffer1,"csv","datos.csv")
And the error I get after running it is:

Code: Select all

"TSP Runtime error at line 7: attempt to index field `mybuffer1' (a nil value)"
What can be the problem? Should I upgrade the firmware to version 3.2.1 or 3.2.2 (the release notes say that I should do so if it solves any problem I'm currently dealing with, but I don't see it mentioned anywhere)? Are 200000 datapoints too big for a buffer (if I'm not wrong, it should be around 3MB)?

Thanks in advance!

EDIT: I should address that, although I'm running the PulseIMeasureV for 100000 points, I want a bigger buffer to run this script for longer in the future
My Keithley TSP scripts repo --> https://notabug.org/rmtoja

Andrea C
Keithley Applications
Keithley Applications
Posts: 1468
Joined: October 15th, 2010, 10:35 am
Country: United States
Contact:

Re: Trouble creating a buffer (error -286)

Post by Andrea C » November 18th, 2016, 8:06 am

The PulseIMeasure() function is not allowing you to specify which buffer is used; it is assuming and using the nvbuffer.

Instead try using the ConfigPuluseIMeasureV() and InitiatePulseTest() functions. The config function has parameter for name of buffer to use.
See page 276 in 2600B Reference Guide (Rev B).

rmtoja
Posts: 9
Joined: November 18th, 2016, 7:13 am
Country: Argentina
Contact:

Re: Trouble creating a buffer (error -286)

Post by rmtoja » November 18th, 2016, 10:08 am

Thanks Andrea for your comment. However, my initial problem about making a buffer still persists. Any idea on how to solve it? Any other error in my code (below you can see its actual state)?

Code: Select all

-- Restore Series 2600B defaults.
smua.reset()
-- Set compliance to 200 V.
smua.source.limitv = 200
-- Crear buffer con 200000 casilleros, y que no junte los timestamps ni los valores de la fuente (porque
-- los fijamos en 1 mA)
mybuffer1 = smua.makebuffer(200000)
smua.mybuffer1.collecttimestamps = 0
smua.mybuffer1.collectsourcevalues = 0

smua.source.output = smua.OUTPUT_ON

f1, msg1 = ConfigPulseVMeasureI(smua, 0, 0.005, 200, 0.001, 0.009, 100000, mybuffer1, 1)
if f1 == true then
f2, msg2 = InitiatePulseTest(1)
print("Initiate message:", msg2)
else
print("Config errors:", msg1)
end

-- Guardar el buffer de datos en el pendrive, en formato csv
savebuffer(mybuffer1,"csv","datos.csv")
My Keithley TSP scripts repo --> https://notabug.org/rmtoja

Andrea C
Keithley Applications
Keithley Applications
Posts: 1468
Joined: October 15th, 2010, 10:35 am
Country: United States
Contact:

Re: Trouble creating a buffer (error -286)

Post by Andrea C » November 20th, 2016, 10:57 am

I suspect you need to set the appendmode to 1 (smua.mybuffer1.appendmode = 1).

This will default to zero and so you would be able to access only mybuffer[1].readings

rmtoja
Posts: 9
Joined: November 18th, 2016, 7:13 am
Country: Argentina
Contact:

Re: Trouble creating a buffer (error -286)

Post by rmtoja » November 22nd, 2016, 11:18 am

Hi!

I've tried with "smua.mybuffer1.appendmode = 1" and that didn't work. I upgraded the firmware, and poked around with my code. Finally, I got it working by creating the buffer with a one line script, and then switching to my script to do the pulse and data collection. Also, I had to change

Code: Select all

smua.mybuffer1.collecttimestamps = 0
smua.mybuffer1.collectsourcevalues = 0
to

Code: Select all

mybuffer1.collecttimestamps = 0
mybuffer1.collectsourcevalues = 0
I think that the manual isn't clear about naming it just "bufferVar" and not "smuX.bufferVar" , as most examples make use of non volatile buffers.

So, for anyone else having problems like this, I leave the code I finally used. Keep in mind that there are some un-commented commands (appendmode, autozero, nplc and the like) that were added every time I got a new error about the pulse configuration. There are also some comments in spanish.

The code for creating a buffer (first script to run):

Code: Select all

mybuffer1 = smua.makebuffer(200000)
The code for the pulse train (second script to run):

Code: Select all

-- Restore Series 2600B defaults.
smua.reset()
-- Set compliance to 200 V.
smua.source.limitv = 200
-- Crear buffer con 200000 casilleros, y que no junte los timestamps ni los valores de la fuente
mybuffer1 = smua.makebuffer(200000)
mybuffer1.collecttimestamps = 0
mybuffer1.collectsourcevalues = 0
mybuffer1.appendmode = 1
smua.source.autorangei = smua.AUTORANGE_OFF
smua.source.autorangev = smua.AUTORANGE_OFF
smua.measure.autorangei = smua.AUTORANGE_OFF
smua.measure.autorangev = smua.AUTORANGE_OFF
smua.measure.autozero = 0
smua.measure.nplc = 0.01
-- Abrir el canal A
smua.source.output = smua.OUTPUT_ON
-- Configuracion del pulso y activado
f1, msg1 = ConfigPulseIMeasureV(smua, 0, 0.005, 200, 0.001, 0.009, 100000, mybuffer1, 1)
if f1 == true then
f2, msg2 = InitiatePulseTest(1)
print("Initiate message:", msg2)
else
print("Config errors:", msg1)
end
-- Guardar el buffer de datos en el pendrive, en formato csv
savebuffer(mybuffer1,"csv","datos.csv")
-- Cerrar el canal A
smua.source.output = smua.OUTPUT_OFF
My Keithley TSP scripts repo --> https://notabug.org/rmtoja

Vince W
Keithley Applications
Keithley Applications
Posts: 108
Joined: September 22nd, 2010, 12:27 pm
Country: United States

Re: Trouble creating a buffer (error -286)

Post by Vince W » November 23rd, 2016, 10:09 am

Hello,

I see you've figured out the problem regarding setting buffer attributes.
When you use one of the internal nonvolatile buffers, smuX.nvbuffer1 or smuX.nvbuffer2, those are permanent elements of the smuX objects.
However, when you create your own buffer, it is an object (table) unto its own - it is not an element of any other object.

VinceW
Image
A Greater Measure of Confidence

Post Reply

Return to “2600 Series SourceMeter”

Who is online

Users browsing this forum: No registered users and 0 guests