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.

-286 runtime error at 2601A

Use this forum for questions about Keithley Test Script Builder software.
Post Reply
tonyliu
Posts: 4
Joined: December 12th, 2011, 6:01 pm
Country: United States

-286 runtime error at 2601A

Post by tonyliu » December 12th, 2011, 6:13 pm

I followed the reference commands in the user manual to measure the current as below. I can get the right reading when I executed those commands one line by one line.

reset()
smua.source.func = smua.OUTPUT_DCVOLTS
smua.source.rangev = 5
smua.source.levelv = 3.3
smua.source.limiti = 10e-3
smua.measure.rangei = 10e-3
smua.source.output = smua.OUTPUT_ON
reading = smua.measure.i()
print(reading)
smua.source.output = smua.OUTPUT_OFF

But, I got the following error when executed all the above commands at once.
-286, TSP Runtime error at line 5: attempt to index global 'smub' (a nil value)

I tried using the SMU_Measure.tsp in the example script, Tutorial_SMU_Command, from your website. But, I still have the same error. (even the same line as line 5.)

Any solution? Thanks!

Nathan S
Keithley Applications
Keithley Applications
Posts: 254
Joined: February 28th, 2011, 6:17 am
Country: United States
Contact:

Re: -286 runtime error at 2601A

Post by Nathan S » December 13th, 2011, 8:15 am

I need a few questions answered for me to best diagnose this issue.

How are you connecting to the 2601A? Ethernet or GPIB? What version of firmware is the unit? What program are you using to send the ICL commands to the unit?

Thanks.

tonyliu
Posts: 4
Joined: December 12th, 2011, 6:01 pm
Country: United States

Re: -286 runtime error at 2601A

Post by tonyliu » December 13th, 2011, 9:27 am

Hi Nathan,

I connect to 2601A through RS232 (serial port). The firmware version is 2.1.6. I use TestScript Builder to send the commands.

Thanks,
Tony

Nathan S
Keithley Applications
Keithley Applications
Posts: 254
Joined: February 28th, 2011, 6:17 am
Country: United States
Contact:

Re: -286 runtime error at 2601A

Post by Nathan S » December 13th, 2011, 1:50 pm

I would try upgrading your 2601A to firmware version 2.2.1 to see if this helps.
http://www.keithley.com/support/keidoc_ ... e=Firmware

However, I'm concerned where you say that its giving you a smub as a nil value error, however, your code does not have anything regarding smub in there. When you run the TSP file in TSB, just try right clicking in whitespace below your commands and select Run as TSP file. The run button at the top can in actuality be running your previously ran script or something else (it is somewhat customizable) other than the code you expect, and your previous example could be for a 2602A where smub is a valid call, but that doesn't function on a 2601A/2611A/2635A.

tonyliu
Posts: 4
Joined: December 12th, 2011, 6:01 pm
Country: United States

Re: -286 runtime error at 2601A

Post by tonyliu » December 13th, 2011, 5:45 pm

The trick to right click for running as TSP file works! Thanks!

Have 2 more questions below. I copied some scripts below for your reference. Basically, we just want to read the data continuously.

1. What's the timing in between the readings? We'd like to know how quick that the machine can read back the data.

2. The savebuffer command keeps overwriting the previous data. Any way that I can record all data?

--- script ---

for i = 0, 10, 0.1 do
reading = smua.measure.i()
savebuffer(smua.nvbuffer1, "csv", "/usb1/data.csv")
print(reading)
end

Nathan S
Keithley Applications
Keithley Applications
Posts: 254
Joined: February 28th, 2011, 6:17 am
Country: United States
Contact:

Re: -286 runtime error at 2601A

Post by Nathan S » December 14th, 2011, 6:38 am

Tony,

1. There is no one answer for the timing of steps as it relies on a number of settings. If you want to get a better idea of timing, I would suggest using the timestamps. The command to enable them is bufferName.collecttimestamps = 1 where bufferName is the name of your buffer. Then you can print the reading and the timestamp. If you are collecting many data and printing them at once, you can use code similar to this after you have taken your readings:

Code: Select all

for j=1,bufferName.n do			--create comma delimited from 1 to final index of bufferName
	print(bufferName[i],",",bufferName.timestamps[i],",")
end
That shows how to print the value with the associated timestamp in a comma-delimited fashion if you use the loop or not.


2. For the reading, it sounds like you need the buffer append mode command. The command for that is bufferName.appendmode = 1 where again you replace bufferName with whatever name you chose for your buffer.

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

Re: -286 runtime error at 2601A

Post by Andrea C » December 14th, 2011, 8:01 am

Hi,

In addition to the good advise that Nathan has provided, I wanted to mention how you can see the source code implementation of the savebuffer(smua.nvbuffer1, "csv", "/usb1/data.csv") function.

Run the following command to get a listing of source code:

script.factory.scripts.KISaveBuffer.list()

Attached is the output from this command.

Andrea
Attachments
KISaveBuffer.doc
source code listing of the savebuffer function
(50.5 KiB) Downloaded 1146 times

tonyliu
Posts: 4
Joined: December 12th, 2011, 6:01 pm
Country: United States

Re: -286 runtime error at 2601A

Post by tonyliu » December 14th, 2011, 4:48 pm

Hi Nathan and Adrea,

Thanks for the info. I'm able to see the timestamp now but the time interval between readings is around 0.017 second while I've set the interval to 0.001 second. (Please refer to the attachment.) I also copied my script below for your reference. Is there any way to reduce the interval? The spec shows that it can reaches 20,000 readings per second.

smua.reset()
smua.nvbuffer1.clear()
smua.source.func = smua.OUTPUT_DCVOLTS
smua.source.rangev = 5
smua.source.levelv = 3.3
smua.source.limiti = 10e-3
smua.measure.rangei = 10e-3
smua.source.output = smua.OUTPUT_ON
smua.nvbuffer1.appendmode = 1
smua.nvbuffer1.collecttimestamps = 1
smua.measure.count = 100
smua.measure.interval = 0.001
reading = smua.measure.i(smua.nvbuffer1)
savebuffer(smua.nvbuffer1, "csv", "/usb1/data.csv")
smua.source.output = smua.OUTPUT_OFF

Thanks,
Tony
Attachments
data.csv
(4.55 KiB) Downloaded 1146 times

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

Re: -286 runtime error at 2601A

Post by Andrea C » December 14th, 2011, 5:55 pm

Hi Tony,

The measure interval is trying to control how often a measurement is repeated, but the measurement itself is influenced by the NPLC setting. That you are getting about 0.017 now makes a lot of sense. The default NPLC setting is 1.0 which equates to 16.7 msec for 60Hz power.

To achieve the 20,000 readings per second rate, add a couple lines to your code:

{snip}
smua.measure.nplc = 0.001 -- 16.7 usec for A/D converter
smua.source.autorangev = smua.AUTORANGE_OFF
smua.measure.autorangei = smua.AUTORANGE_OFF

smua.measure.interval = 50e-6 -- the 20kHz reading rate
{snip}

Andrea

Post Reply

Return to “Test Script Builder”

Who is online

Users browsing this forum: No registered users and 1 guest