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.

Using TSB, file I/O commands

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

Using TSB, file I/O commands

Post by keithleyuser » December 4th, 2010, 12:23 pm

Hi,

I have been trying to use the file I/O commands to write the data from the instrument to a file. I am new to using LUA and TSB. I have been able to figure out how to "write to file" using LUA and a seperate compiler, but I have not been able to do so in TSB. The "io.open", "io.input", and "io.output" commands does not seem to work. I have created a test file named "c:\test.txt", but everytime I try to open this file in the TSB command window, I get the error "2203 file or directory error". Log:

TSP>fid = io.open("C:/test.txt","r")
2203, File or directory error

Please help!

Thanks.

Tom Sw
Keithley Applications
Keithley Applications
Posts: 78
Joined: May 9th, 2010, 12:38 pm
Country: United States

Re: Using TSB, file I/O commands

Post by Tom Sw » December 5th, 2010, 7:26 am

The file I/O commands will not allow you to create files on the PC's hard drive. These commands only work on a USB drive connected to the instrument.

atunnell
Posts: 2
Joined: August 31st, 2011, 10:46 am
Country: United States

Re: Using TSB, file I/O commands

Post by atunnell » August 31st, 2011, 10:59 am

I am having a similar problem. I am using a Keithley 2612A Sourcemeter and TSB Version: KTS-850D01.

I am able to run a voltage sweep, store current readings into the buffer (nvbuffer1), and print those readings in TSB, but it fails to export the buffer data to a file.

savebuffer(smua.nvbuffer1, "csv", "data.csv")
produces "2203, File or directory error."

I have a USB flash drive plugged into the front the sourcemeter. Does it need to be formatted in a particular way? It is an 8Gb drive, FAT32 file system currently.

Thank you for any assistance.
Andrew

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

Re: Using TSB, file I/O commands

Post by Nathan S » August 31st, 2011, 11:29 am

Andrew,

Try savebuffer(smua.nvbuffer1, "csv", "/usb1/data.csv")

In order to save to the USB drive you must add /usb1/ at the beginning of your filename. You can see this on page 135 of the 2600A Reference Manual Rev D which is page 7-7 of the actual manual where it explains the savebuffer commands in depth.

atunnell
Posts: 2
Joined: August 31st, 2011, 10:46 am
Country: United States

Re: Using TSB, file I/O commands

Post by atunnell » August 31st, 2011, 12:43 pm

Nathan,

Thank you. I had missed the "/usb1/" comment before, but I'm still getting the same error. It seem to be a problem communicating with my USB flash drive because even when I use the front panel (STORE, SAVE, USB1, CSV, SMUA_BUFFER1, smua1buffer000.csv) I get the same error, "Error Code: 2203, File or directory error." Both flash drives I have tried have had the same result. They both light up when plugged in.

I tried to update the firmware with 2600A-850SV2.1.6 on my USB drive, but it claimed "no files found." I was able to update it through TSB.

Also, the example given in the 2600A Reference Manual Rev D on page 558 (19-274) is:
savebuffer(smua.nvbuffer1, "csv", "mybuffer.csv")
Without the "/usb1/", I assumed it would be saved in my TSB workpace folder. What should that command do?

Andrew

Post Reply

Return to “Test Script Builder”

Who is online

Users browsing this forum: No registered users and 4 guests