02-25-2013 07:09 AM
Hi,
My acquisition device throws out chunks of data every 50 to 51 ms at a sample frequency of 2048 Hz.
I use a standard producer / consumer structure for acquisition and displaying of the data.
Now when my logging is "ON" i write 1 second of data to my harddrive every second (this works with a shift register), this time, my enqueue has a little delay, so my de-queue also have to wait to display the data...
Now i was thinking about a solution, i can buffer 3 pieces of data and then only de-queue the last piece, but if i use the count of the queue and i say the count has to be 3, i also get a delay, because then it waits untill the count is 3 again... so the i only shift the problem....
Difficult...
Best regards,
Thijs
02-25-2013 09:26 AM
I would do your buffering in the display case. Don't bog down your acquisition with unnecessary processing. Simply post the data to the display task. Have the display task buffer the contents in a shift register and use the current time to indicate when the buffered data should be written to the file. Also, I would recommend that you get rid of the stacked sequence frame. I don't have LV 2012 installed but I am quite sure you could refactor your your code to eliminate the stacked sequence frame.