LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Accurate timestamp on strip chart with scrolling

Solved!
Go to solution

I have a user interface with a set of synchronized charts that are operating in a scrolling stripchart mode.  The X-axis scrollbar is visible on one of the charts, and the operator has the capability of pausing the update of that chart (basically locking out the input to the chart) and scrolling back through some history.  The chart width is about a minute of data, the number of points has been set to allow about an hour of history scrolling.  The other charts that are synchronized with this main chart have x-axis property nodes attached, so that they follow the scrolling of the primary chart.

 

Everything works just fine with the current setup, except for one little detail:  timestamps.  I need to put accurate date/time stamping visible on the X-axis of the primary chart, so that the operators will know exactly when any aberration in the data truly occurred.  I've seen a few entries into how to add real timestamping, but none of those seemed to work correctly.  They work fine on a standard test chart, but fail miserably once the scrolling action is enabled, so I must be doing something wrong.  

 

Any suggestions on the best way to get this timestamping accomplished?  It is absolutely insane to me how much of a pain putting an actual real world timestamp into a chart is...  As someone who constantly defends LabVIEW against my colleagues who claim it is "too difficult" to utilize, it is rather embarrassing when something so simple becomes so convoluted in LabVIEW!  Smiley Frustrated

0 Kudos
Message 1 of 3
(4,405 Views)
Solution
Accepted by topic author Vrmithrax

The short answer is that you can't do this with a chart if you add the requirement of being able to pause. The reason for that is simple - a chart stores the data on its own, but it doesn't store any X values - you only feed it Y values and for the X values it simply uses the index of the value and the most you can do is set a t0 and delta t for the X scale. This works normally, but wouldn't work when you stop feeding data to the chart, because the X value isn't stored. I heard someone say once that a waveform chart does allow this, but I never looked into it and I'm not sure it's true.

 

What you can do is use a graph instead of a chart - in a graph you provide both the X and Y values for each point, so you can have absolute time values for the X axis. The key point is that for a graph you have to provide all the data to draw, so you need to manage a circular buffer of the data yourself. You can do this using a lossy queue, where you preview the queue to get the data, but there are also some examples online, as well as in the example finder, if you search for "XY chart".


___________________
Try to take over the world!
Message 2 of 3
(4,382 Views)

Thanks, that makes some sense...  I'm wondering if my best solution might be to bypass the whole "pausing" routine, and instead just be logging the data with an accurate timestamp...  An external historical viewer that allows zooming and scrolling of logged data is something I've been contemplating adding to our product anyhow, so this might be the time to do it and kill 2 birds with 1 stone...  Decisions, decisions!

0 Kudos
Message 3 of 3
(4,343 Views)