LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sequentially updating and replacing elements in a fixed size array

Hi,

I have a set of weather data collected every 2 minutes from an older DAQ system that I have interfaced with Labview using an active X, the data are written to a file everytime a new row of data are collected. The data has it's own timestamp in the form of  year - month - day - hour - min and then the data point following in 5 columns.
Then I want to plot this data on 5 graphs with x-axis made up of the time stamp  and the y-axis with the data values of the seperate columns. The graphs should show the values from the previous 10 days (7200 data points) and constantly update it self with new data.
How do I get the array feeding the graph plotting function to delete the oldest data point at the beginning and add the new data point at the end hence keeping the total lenght of the array constant at 7200. I wanted to set the length of the array to avoid creating a very large array as time goes as this runs 24-7-365 through out the year. Or if there is a another better way of doing this?
I also have a question of how to convert the incoming timestamp to a timestamp in labview format that I can plot on the x-axis. The incoming timestamp looks like this:

year  month  day  hour  minute
2005 07 27 13 10
2005 07 27 13 12
2005 07 27 13 14

Thanks for a great forum 🙂


0 Kudos
Message 1 of 2
(2,808 Views)

You have 2 basic options - You can use a graph and hold 5 1D arrays, replacing the first element and rotating the array each time. If you do this with a shift register, it should satisfy your requirements (example).

The other option is to use a chart. A chart only requires that you give it the new data point (or a cluster of 5 in your case) and it holds the rest in memory. A chart requires a constant distance between all points (Multiplier) and that you give it a starting X value (Offset). You can do this by creating a property node for the chart and wiring in the values before you start.

You can parse the incoming data and build it into a time cluster, which you can convert to a timestamp, like so:

The functions can be found in the Time & Dialog palette.

Search the Example Finder (Help>>Find Example) to see some of the other stuff.


___________________
Try to take over the world!
0 Kudos
Message 2 of 2
(2,802 Views)