LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to plot acquired signal against time with fixed time length using XY graph?

Solved!
Go to solution

Hi,

 

My objective is to plot the acquired signal against time with fixed time length dynamically. Generally speaking, it is like plotting the signal waveform against time in a graph, but only keep the recent 10 min waveform. My current approach is to get the timestamp by one VI and the use XY graph express VI  to make the plot. The result keep all the data in history which is not what i want. My question is that how to acheive my purpose?

 

 

Many Thanks

Hao

0 Kudos
Message 1 of 3
(3,956 Views)
Solution
Accepted by Hao_Liu

One way to show the most recent ten minutes of data is to use a chart in place of a graph. Set the Chart History size for the number of samples you acquire in ten minutes.

 

If you want to use the XY graph you will need to manipulate the data yourself. If you only want the data from the most recent ten minutes and you want to discard all older data, set up a circular buffer sized to hold the ten minutes of data. Once the buffer is full (after the initial ten-minute interval) adding a data point will remove the oldest point. Make the buffer a 2D array with the X data in one row and the Y data in the next row. A lossy queue can be used in recent versions of LV to implement a circular buffer. In older versions an Action Engine would be a good choice.

 

Lynn

0 Kudos
Message 2 of 3
(3,934 Views)

To reinforce Lynn's comments, the chart is much easier but the caveat is that you can only use it if the samples are coming in at a constant rate. If the time between samples varies you will have to use an XY graph.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 3
(3,928 Views)