LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time doesn't match sampled data?

Hallo all experts,

I write a LV code which reads data from USB 6211 and saves them with time instants in a text file, but the time instants don't correspond the sampled data. The time values are generated by elapsed time, after build array with the data read from DAQ, they are fed to the write to a text file. The test signal is 10 Hz, but the text file yields 0.2 Hz signal. How could I synchronize them?

Any tips are highly appreciated.

win2
0 Kudos
Message 1 of 8
(3,610 Views)
It is hard to imagine how 10Hz can turn into  0.2Hz, unless you do some uneeded math somewhere. Can you show us your code?
0 Kudos
Message 2 of 8
(3,603 Views)

The attachments are my vi file and sampled data.  10 Hz square wave produced from a function generator is fed to analog 1, but the results seems quite strange.

Any help is greatly appreciated.

win2s

Download All
0 Kudos
Message 3 of 8
(3,582 Views)
Any idea?Smiley Sad
0 Kudos
Message 4 of 8
(3,569 Views)

Don't use the "elapsed time" express VI for precision timings. It seems to have limited resolution (internally, it converts a timestamp to DBL).

You can use e.g. the tick count to keep track of the time. See the attached comparison. (still there will always be some subtle differences due to the software timings).

0 Kudos
Message 5 of 8
(3,558 Views)
Hi altenbach,
 
I have tried tick count, but the results are still strange. If it has nothing to do with my cpu: AMD Athlon(tm) XP 1600+ 1.40GHz, 512 MB RAM, I think it should be due to some setting problem with my usb6211.
 
Help!
 
win2s 
0 Kudos
Message 6 of 8
(3,554 Views)
Has nobody come across such situation?
win2
0 Kudos
Message 7 of 8
(3,523 Views)

I play further with this vi code, and found:

The sampled data largely depend on the sample rate which is set at DAQmx Timing.  In case the rate is set larger than 63kS/s, there will be no data in the text file. Smaller the rate is, the better results man could get, i.e. when I set the sample rate at 1kS/s, mostly the result seems loyal to the voltage curve generated from a function generator. Another weird thing which comes to pass is that sometimes the beginning data are compressed no matter whether rate is set small or large, but some times it dosn't happen.

My computer is quipped with usb2.0 and usb1.0/1.1, when I plug the usb6211 into the 1.0/1.1 socket, the computer can identify it, but the computer fails to identify if it is connected to 2.0 socket. In the control panel, the driver to the usb advanced hostcontroller is there. The driver for usb6211 has been surely installed for it seems to work properly with usb1.0/1.1 interface. How could I put it straight?

Any advice is greatly appreciated,

 

win2s

0 Kudos
Message 8 of 8
(3,510 Views)