LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform Chart with actual time for the X-Axis

Okay so I see this question asked repeatedly and never really have seen a good explanation of how to get actual time in the X axis. Sure there are a lot of simple examples that seem to work perfectly for one second update intervals, but fail at anything else.

 

I have a chart that is going to be updated at regular intervals. But that interval could be basically 10mS to Infinity, although in reality I can probably limit this to 1 second min and 1 hour max. The update rate will not change during runtime. The default chart time span should be one hour but the time span shown on the chart needs to be adjustable. For instance after there are a few hours of data collected someone might want to only see the last 30 minutes on the chart. This also needs to be resettable back to see all history data.

 

Also the chart should start empty and data should be plotted on the left (the start time) and work it's way to the right as data is added, then scroll left once the timespan shown is reached.  Oh and I don't want the graph to be reset back to default every time it's updated either. 

 

I am open for suggestions and adding controls. The software I am trying to emulate has a data chart with selectable time ranges of 1,2,5,10,20,30 minutes and 1-24 hours. Something similar to that is what I am after.

 

I am sure there are a few things I am forgetting but I will add them later...

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 1 of 2
(1,169 Views)

If by actual time you really mean absolute time simply give the waveform a t0 of "Now" in seconds elapsed since the beginning of 1904 in UTC , Greenwich mean time, ignore the 37 leap seconds. 

 

Calculate the chart history length you need based on dt and time to acquire.   Turn off auto scaling and you can fake a strip chart by playing with the axis scale start and end points.  Remember a chart plot is essentially a rolling buffer.  You can't get back what fell off the front end


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 2
(1,093 Views)