05-27-2016 04:01 PM
Hi guys,
I'm having trouble with a waveform chart axis. In my program the data comes in at about 100ms, but there is some delay sometimes. So over the course of a day, the time axis might be off by a couple minutes. It isn't a huge deal, but I'd like to fix it.
In my example, the data is expected at 10ms (XScale.Multiplier) but actually comes in at 12ms. The chart holds 1000 points, to show 10 seconds worth of data. In the "Fix" event, I reset the XScale.Offset to be 10 seconds before the current time, and make XScale.Maximum equal the current time. This assumes the chart history is full.
I thought this would do the trick, but the scale does not come out as I want, with the right side of the scale being current with the time.
Can anyone spot where I've gone wrong?
05-27-2016 04:29 PM
could some thing like this I done in your vi
fix your problem?
05-27-2016 04:31 PM
05-27-2016 04:34 PM
@Hatef.fouladi wrote:could some thing like this I done in your vi
fix your problem?
Nope, the Elapsed Timer express VI doesn't help here, but I found my error. I thought the XScale.Offset property would be the time of the first datapoint in the chart history, but I saw that even as the chart history got overwritten by new values, the Offset doesn't change!
So my solution: Find how much the current time differs from the right side of the graph and add that to the Offset!