From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

time in seconds to x-axis of a chart

I have logged a fair bit of data at 2.6667 second time intervals inside
Labview. Each sample has a timestamp which was the time in seconds since
1904 when the sample was taken. Some samples were discarded at the time
of sampling and weren't logged. I now want to play this data back to the
equivalent of a scrolling chart. The problem I'm having is getting the
time in seconds wired into the x-axis of this chart as the delta x-part
isn't uniform and the timescale does not correspond to what is plotted
on the chart. What is important to me is that the solution displays as a
scrolling chart with the correct time on the axis.

Any pointers or suggestions would be appreciated.

Thanks

Steve
0 Kudos
Message 1 of 3
(3,831 Views)
The simplest would be to display a subset of your data in an XY plot and
move your data "window" to give the illusion of a scrolling plot, either by
extracting the required data from the array on each iteration or by sending
the whole of the dataset to the XY plot and simply changing the X axis range
on each iteration.

If the speed hit means you must use a chart, then the only way is to supply
equally spaced datapoints to the chart by faking them when they're not
available- if you use an off-scale value and handle the ranging yourself
then the missing and faked points need not be visible on the plot.


Steve O'Donnell wrote in message
news:3A1036D5.4AE230AE@dial.pipex.com...
> I have logged a fair bit of data at 2.6667 second time interv
als inside
> Labview. Each sample has a timestamp which was the time in seconds since
> 1904 when the sample was taken. Some samples were discarded at the time
> of sampling and weren't logged. I now want to play this data back to the
> equivalent of a scrolling chart. The problem I'm having is getting the
> time in seconds wired into the x-axis of this chart as the delta x-part
> isn't uniform and the timescale does not correspond to what is plotted
> on the chart. What is important to me is that the solution displays as a
> scrolling chart with the correct time on the axis.
>
> Any pointers or suggestions would be appreciated.
>
> Thanks
>
> Steve
0 Kudos
Message 2 of 3
(3,831 Views)
> I have logged a fair bit of data at 2.6667 second time intervals inside
> Labview. Each sample has a timestamp which was the time in seconds since
> 1904 when the sample was taken. Some samples were discarded at the time
> of sampling and weren't logged. I now want to play this data back to the
> equivalent of a scrolling chart. The problem I'm having is getting the
> time in seconds wired into the x-axis of this chart as the delta x-part
> isn't uniform and the timescale does not correspond to what is plotted
> on the chart. What is important to me is that the solution displays as a
> scrolling chart with the correct time on the axis.
>
> Any pointers or suggestions would be appreciated.

You don't mention what version of LV you are using. If you are or can
use L
V6, then you can do this with the Waveform datatype. The waveform
is an semi-opaque datatype that includes a timestamp with one or more
measured values. Since you can wire it to a chart, you can accumulate
discontiguous data. In a normal acquire and chart application that now
returns a waveform and you send it to the chart, the irregular sampling
automatically shows up. If you are reading them from file, then you can
pretty easily bundle the evenly sampled portions together into one
waveform, then start another to skip ahead when you find a skip.

If you are stuck using a previous version, then I'm afraid you
will need to use an XY graph, possibly with the accumulation functions
in the example I recently listed or use your own shift registers and
build array.

Greg McKaskle
0 Kudos
Message 3 of 3
(3,831 Views)