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.

Time intervals between data points

Use this forum for questions about Keithley Test Script Builder software.
Post Reply
Posts: 1
Joined: July 6th, 2011, 2:20 pm
Country: United States

Time intervals between data points

Post by hardaccount » July 6th, 2011, 2:25 pm


I have a TSP file that I am using with the Keithley 2602 to make voltage measurements. I am able to capture the data from the machine, but I have no idea about the sampling rate.
It seems that there are two functions that affect the sampling rates of the data:
smuX.measure.interval, and delay. Below is the script that I am running, however I am not sure if I can figure my sampling rate.

I can probably set up an experiment to test it by hand, but surely there is another way. My code is as follows:


time = 100

local l_count = time


smub.measure.interval = .1

smub.source.output = smub.OUTPUT_ON

for j=1, l_count do
smub.measure.v (smub.nvbuffer1)


printbuffer(1, l_count, smub.nvbuffer1)


Any assistance that can be offered would be greatly appreciated.

- Yohan

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

Re: Time intervals between data points

Post by Andrea C » July 7th, 2011, 10:12 am


The smub.measure.interval command in your script is having no effect on the timing. This command is used together with smuX.measure.count to control the timing between subsequent measurements for measure count greater than 1.

In general, the the SourceMeter executes a Source-Delay-Measure cycle. There is some overhead to accomplish the sourcing; followed by a programmable amount of measure delay if you need some to allow for settling; followed by the time to perform a measurement. The time to perform the measurement is affected by auto zero, auto range and the integration time (NPLC).

There are multiple approaches that can be used to know the time between data points, but use of the buffer timestamps might be the most straightforward.

Here is a modified version of your script:

-- Prints the results from the reading buffers.
function printData()
if smub.nvbuffer1.n == 0 then
print("No readings in buffer")
for i = 1, smub.nvbuffer1.n do
print(string.format("%g\t\t\t%g", smub.nvbuffer1.timestamps, smub.nvbuffer1.readings))
end -- function

time = 10

local l_count = time

smub.nvbuffer1.appendmode = 1
smub.nvbuffer1.collecttimestamps = 1

smub.measure.interval = .1
smub.measure.count = l_count

smub.source.output = smub.OUTPUT_ON

--for j= 1 , l_count do



smub.source.output = smub.OUTPUT_OFF

--***************** END SCRIPT****************************

Here is a sample output from Test Script Builder:

TSP>Timestamps Reading
0 1.0705e-05
0.099999 9.39369e-06
0.199999 1.12295e-05
0.299999 1.25885e-05
0.399999 9.13143e-06
0.499999 1.10626e-05
0.599999 1.09673e-05
0.699999 1.16825e-05
0.799999 1.05143e-05
0.899999 7.82013e-06


Posts: 4
Joined: February 7th, 2012, 9:21 pm
Country: India

Re: Time intervals between data points

Post by raghubodi » February 8th, 2012, 11:01 pm

I have a DI-148U device and I'm using the DataqFile activeX control to obtain recorded data in a program that performs various calculations from that data. One of my data channels represents velocity as determined from a Vehicle Speed Sensor. I am calculating acceleration from the change in velocity divided by the time between the data points used. I am assuming that the time between each successive data point in the Windaq file is 1/SampleRate, where I obtain SampleRate using the DataqFile property "SampleRate()". Is this correct and is there anything else I need to consider for maximum accuracy?

Post Reply

Return to “Test Script Builder”

Who is online

Users browsing this forum: No registered users and 0 guests