11-10-2011 10:41 AM
Hi,
I am receiving data through EGD and writing the data to TDMS files every hour. I am using the elapsed time vi with a case structure to determine when the hour has elapsed. This triggers the current tdms file to close and open a new one. I have used a producer loop to receive the data at 100 Hz, which is put into a queue then consumed in another loop when it is processed and written to tdms.The timestamp is part of the egd data i am receiving and I need my data to be correctly timestamped. However, when i run the program the time becomes gradually more out of sync or increasingly lags the actual time. Is this because the queue becomes backlogged and the timestamp comes out the queue at a later time? Any suggestions as to how I can rectify this?
Thanks
11-10-2011 10:48 AM - edited 11-10-2011 10:51 AM
Well, if the time is part of the data that you are receiving it should also be in the data that is being transferred in the queue. Use that file to timestamp the data - not when it is being saved.
Mike...
11-10-2011 10:53 AM
Hmmm... in my previous post it should read "...use that time value..." not "...use that file..." - for some reason the system woun't let me edit posts I just made.
Mike...
11-14-2011 02:31 AM
so do you mean timestamp the data before it goes into the queue?
11-14-2011 06:02 AM
11-14-2011 06:11 AM
There is a time associated with it, each data packet contains header data (including time) then some measurement data. The data packets are queued once received then sent to the cosumer loop to be processed. However, when i look at my hourly TDMS file it only contains data for around 40 minutes, then the next TDMS file starts off not from the time it was opened but from where the previous TDMS file terminated (ie from 41 minutes). So basically, it looks like my problem is i am not processingthe data / writing data to file fast enough as the tdms file does not conatin all the data it should and data is getting held up in the queue...I've attached the code is this will help to give you an idea of my problem.
Thanks.