12-26-2008 03:18 PM
I'm collecting data from an instrument once per minute and adding each value to an array. After many days there are alot of values in the array. I want to be able to select a time, ie 4 hours, and have the last 4 hours of values added together so it can be displayed. Any ideas. Thanks in advance for the help.
ssmith
Solved! Go to Solution.
12-26-2008 03:31 PM - edited 12-26-2008 03:40 PM
Use Array Subset and Add Array Elements.
Once per minute = 60 values per hour.
Number of Hours * 60 = number of elements you want.
So subtract Number of Elements from Array Size to get your index.
Quick and easy!
8-)
12-26-2008 03:39 PM - edited 12-26-2008 03:40 PM
hello,
try this
12-26-2008 03:42 PM
12-26-2008 03:45 PM
I'm guessing this is a continuation of this thread, so my suggestion below is based on this. In the screenshot you posted you are using Build Array. A couple of points first:
Now, as to your question: Since your samples are not evenly spaced, then you must determine where to take an array subset. To do this you need to know what the time was 4 hours ago, and determine which array element is beyond this. You can accomplish this by a simple comparison operator and then search the 1D array for the first True/False. This tells you where the 4-hour cutoff is, and where you can take the Array Subset.
12-26-2008 04:45 PM
tinnitus wrote:try this
From the other thread, it seems that ssmith is using LabVIEW 7.1. Attaching a 8.6 VI without any explanation is not very helpful.
12-26-2008 05:25 PM
hello altenbach,
there is a simple chain with simulated aquisition that a child could understand,
about 7.1.1 it 's written nowhere, on simple demand i can also repost or send a pict
good night ( at least for me)
@+
Tinnitus
12-26-2008 06:35 PM
Thanks a lot. Works great.
ssmith