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.

Making two sweeps and then printing their data

Use this forum for questions about Keithley Test Script Builder software.
Post Reply
Shaleen
Posts: 5
Joined: July 11th, 2013, 6:45 am
Country: India

Making two sweeps and then printing their data

Post by Shaleen » July 16th, 2013, 7:21 am

hi,
can anyone tell me how to make two sweeps one after the other and then printing their data? It is essential to print data after the two sweeps because no time delay must be present between the two sweeps.
I have written the following script-



smua.reset()
-- Set compliance to 1 A.
smua.source.limiti = 1
-- Linear staircase sweep
-- -5 V to 5 V, 0.1 second delay,
-- 10 points.

SweepVLinMeasureI(smua, -5, 5, 0.1, 10)
printbuffer(1,10,smua.nvbuffer1.readings)
printbuffer(1,10,smua.nvbuffer1.sourcevalues)

SweepVLinMeasureI(smub, 5, -5, 0.1, 10)
printbuffer(1,10,smub.nvbuffer1.readings)
printbuffer(1,10,smub.nvbuffer1.sourcevalues)



but time delay is observed between the two sweeps. Any way to eliminate this time delay??
I am using Keithley 2602a instrument.
-Thanks

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

Re: Making two sweeps and then printing their data

Post by Andrea C » July 17th, 2013, 8:10 am

Hi Shaleen,

Did you intend to use smua for the forward sweep and then use smub for the reverse sweep?
Or do you simply need one smu channel to perform a dual sweep (up and then back)?

Most likely, a list sweep will be of value for this. You'll be able to perform the up and back sweep, without interruption. And then at the end of the dual sweep, obtain the data.

Code: Select all

myvlist = {0,1,2,3,4,5,4,3,2,1,0}

local numPts = 11
local meas_delay = 1e-3

SweepVListMeasureI(smua, myvlist, meas_delay, numPts)

printbuffer(1,numPts,smua.nvbuffer1.readings)
print()
printbuffer(1,numPts,smua.nvbuffer1.sourcevalues)
You can obtain the source code implementation of the KISweep library for linear, log and list sweeps by issuing command:
script.factory.scripts.KISweep.list()

In Test Script Builder, enter this command at the TSP> command prompt in the Instrument Console window. You'll then be able to copy and paste the code listing into a tsp file structure or Notepad++ or similar.

Andrea

Shaleen
Posts: 5
Joined: July 11th, 2013, 6:45 am
Country: India

Re: Making two sweeps and then printing their data

Post by Shaleen » July 19th, 2013, 7:38 am

Dear Andrea,

Thanks a lot for your reply, it helped me a lot, readings are coming as expected. Sorry for my mistake, i intended to use just one smu channel (either smua or smub) to perform dual sweep, up and then back. Only problem with this method is that if i need to measure a large no. of points between sweeps, like 200 points, then the list method becomes tedious. Is there any alternative to this so that i can measure a large no. of points between sweep?


Thanks a lot
Shaleen

Shaleen
Posts: 5
Joined: July 11th, 2013, 6:45 am
Country: India

Re: Making two sweeps and then printing their data

Post by Shaleen » July 19th, 2013, 7:52 am

Hello Andrea,

In particular, is it possible to perform the following-
1) measure current by using SweepVLinMeasureI factory script for voltage sweeping from -5V to+5V.
2) store readings and source values of forward sweep from -5V to+5V in nvbuffer1.
3) then measure current by using SweepVLinMeasureI factory script for voltage sweeping from +5V to-5V.
4) store the readings and source values of this reverse sweep in nvbuffer2.
5) and finally printing readings and source values of forward and reverse sweeps from their respective buffers.
This will solve my problem. :)

Thanks a lot,
Shaleen

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

Re: Making two sweeps and then printing their data

Post by Andrea C » July 20th, 2013, 1:45 pm

You'd have to create your own implementation of the SweepV function so that it handles the buffers as you desire.

Alternately, you could use a loop to load the voltage list sweep.
The code below is a crude approach but shows the idea.
You if you want increment_v to be smaller than 1, then you'll have to adjust the values used by the for loop accordingly.
Perhaps you can think of a more robust way to implement this aspect of it.

Code: Select all

myvlist = {}

local increment_v  = 1
-- load table with the forward sweep values
myvlist[1] = -5
for i = 2, 11 do
   myvlist[i] = myvlist[i-1] + increment_v
end

-- load table with the reverse sweep values
for i = 12 , 21 do
   myvlist[i] =  myvlist[i-1] - increment_v 
end

local numPts = table.getn(myvlist)
local meas_delay = 1e-3

SweepVListMeasureI(smua, myvlist, meas_delay, numPts)

printbuffer(1,numPts,smua.nvbuffer1.readings)
print()
printbuffer(1,numPts,smua.nvbuffer1.sourcevalues)

Shaleen
Posts: 5
Joined: July 11th, 2013, 6:45 am
Country: India

Re: Making two sweeps and then printing their data

Post by Shaleen » July 22nd, 2013, 4:15 am

Cool!! Thanks a lot Andrea :) problem solved. :D

Post Reply

Return to “Test Script Builder”

Who is online

Users browsing this forum: No registered users and 5 guests