Page 1 of 1

Time intervals between data points

Posted: July 6th, 2011, 2:25 pm
by hardaccount
Hello,

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.nvbuffer1.clear()

smub.measure.interval = .1

smub.source.output = smub.OUTPUT_ON

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

end

printbuffer(1, l_count, smub.nvbuffer1)

----------------------------------------------------------------------------------------------------------

Any assistance that can be offered would be greatly appreciated.

- Yohan

Re: Time intervals between data points

Posted: July 7th, 2011, 10:12 am
by Andrea C
Hello,

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:
reset()
errorqueue.clear()

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

time = 10

local l_count = time

smub.nvbuffer1.clear()
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
--delay(.0001)
--smub.measure.v(smub.nvbuffer1)
--end

smub.measure.v(smub.nvbuffer1)

printData()

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

Andrea

Re: Time intervals between data points

Posted: February 8th, 2012, 11:01 pm
by raghubodi
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?