LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

timing error using producer/conumer with queue

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

 

 

0 Kudos
Message 1 of 6
(2,365 Views)

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...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 6
(2,364 Views)

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...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 6
(2,358 Views)

so do you mean timestamp the data before it goes into the queue?

0 Kudos
Message 4 of 6
(2,334 Views)
If there us not alesdy a time associated with it, yes.
Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 6
(2,324 Views)

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.

0 Kudos
Message 6 of 6
(2,319 Views)