01-28-2004 07:38 AM
01-28-2004 08:41 AM
08-12-2011 04:35 PM
I just read this post and I'm experiencing the same problem. I'm sampling 3000 samples at 25kHz however I only get a time stamp once every 3000 samples. Is there anyway to get a time stamp for each of those 3000 samples? How do you know for sure that there is 1/25000 seconds between each sample?
08-12-2011 04:51 PM
The time between samples is set by the sampling clock on the datra acquisition device. Usually those clocks are derived from quartz crystal oscillators. The accuracy should be in the device data sheet. Even very inexpensive oscillators of that type have accuracies of about 50 parts per million (ppm). The timebase of the PCI-6221, a low cost multipurpose DAQ device has a 50 ppm timebase. Some higher performance devices may have oscillators which are much better if you need more accuracy.
For your 25 kHz sampling the sample clock period is 40 us. A 50 ppm error would change that by 2 ns. The time of the 3000th sample might be off by 6 us or < 1/6th of one sample period. Since the timestamp resolution is about 1 millisecond, this does not seem very relevant.
Lynn
08-15-2011 10:34 AM - edited 08-15-2011 10:35 AM
So there is still no way of recording the time stamps at a sub milisecond level? If I wanted to figureout the time for some data point inbetween the first sample and the 3000th sample, I'd have to linearly interpolate?
08-15-2011 10:59 AM
You can calculate the time of sample i, T[i] = timestamp of sample 0 + (i+1)*dt, where dt = 1/fs and fs = sample frequency.
As far as I know, none of the standard DAQ VIs do this calculation for you. Most people record the T0 and dt or fs and calculate anything else they need later. Recording timetstamps which differ by exactly dt consumes a lot of storage space.
Recording individual timestamps is usually done only when the acquistion is software timed or has irregular intervals for some reason.
Lynn
08-15-2011 11:01 AM - edited 08-15-2011 11:03 AM
Thanks Lynn
I also wanted to add to my previous post:
I'm recording the DAQ measurements using the WritetoMeasurement.vi I've enabled X Value (Time) Columns however the time values provided don't match with what is actually happening or with Tick Count (ms). Does the WritetoMeasurement.vi use a different clock?
08-15-2011 11:10 AM
I have not used that VI. Perhaps someone else can answer. Have you opened its diagram to see what it does inside?
Lynn
08-15-2011 11:13 AM
The Write to Measurement File uses the time information that you provide. With NI hardware/woftware, this would be from a waveform data type or dynamic data generated by the DAQmx driver. You hijacked this old thread so it is unclear if you are using the Keithley DAQ as in the original post. You need to provide that sort of detail and it would be even better if you attached your code. You are missing something basic but impossible to tell what.
08-15-2011 11:30 AM - edited 08-15-2011 11:33 AM
Sorry for the Hijack. I figured since a thread was already created, I'd just continue off it.
I've attached the code to this post. Basically I'm trying to record position data from an EPOS 2 24/5 motor controller and an NI USB DAQ-6210. I'm trying to record as fast as possible.
What I don't know is if the measurement from the DAQ is synchronized with the reading from the GetPositionIS.vi. This was the rationale for getting time stamps at each of the 3000 data points.