10-07-2011 01:58 PM
The probable reason for the time drift is because the strip chart is not a deterministic real-time control. For that matter, not even the timer control is deterministic, since Windows itself is not a real-time operating system.
The strip chart allows you to display the time associated with each data point, but it usually refers to the time at which the data point was acquired, not the time when you plotted it. Those two can be similar, but they can also be very far apart. You simply cannot rely on a constant, deterministic, plotting time.
The gain in the x-axis of the strip chart should match your acquisition's sampling rate. And the offset of the x-axis should match the acquisition's t0. Later on, when you plot the data, your plotting speed might or might not be able to keep up with your acquisition rate -- it might even take place in a different thread altogether -- but either way, I don't think you should be trying to display the actual plotting time.
Luis
02-14-2012 06:41 AM
For those wanting absolute time labels in strip chart even if the update rate is not precise (typical case of using a timer), I've put together a small piece of code that does this for 1s to 1 year resolution. It simply replaces the PlotStripChart function (well, almost) and can guess the best date/time label to use. I know I'm gonna add it to tens of my past codes later today: TimeStripLabel