Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Store the voltage in an array and reset after a time

Solved!
Go to solution

Hi, I'm getting data continuously from meter for interval of 1 second I have to store the data in an array for 10 mins and reset the data after 10 mins.

My aim is to take average, minimum, maximum for 10 mins of voltage. I'm tired using shift registers but i failed on it,suggest me best way to do it.

Thankz in advance

0 Kudos
Message 1 of 5
(2,989 Views)
Solution
Accepted by topic author praveenrajk

This post might get a better response in the general labview forum instead of this one which is specialized on certain hardware configurations and determinism problems.

 

It might be useful for you to share your code or at least describe how it "failed"

 

Do you know in advance an "upper bound" for how many points you can get in those 10 minutes? If so, you can store that data in a circular buffer:

http://www.ni.com/tutorial/7188/en/http://www.ni.com/tutorial/7188/en/ 

 

None of those statistics (min, max, average) require you to store the array and can be calculated point by point—

Min Max Avg2.png

Message 2 of 5
(2,955 Views)

Thank you so much for your help, it is working perfect on average and maximum case but in minimum, by default the value is set to zero, but in my case voltage value will always greater than zero, so it displays minimum value is zero. I'm struck here, how to set initial value of minimum block as initial voltage of my meter and then starts to comparing the upcoming voltage. 

 

0 Kudos
Message 3 of 5
(2,948 Views)
Solution
Accepted by topic author praveenrajk

FYI, that image is a snippet so you should be able to drag it into your block diagram to see the "true" case. It's supposed to look like this so that the initial value for min, max, and sum are all set to the incoming value:

average stream rate 2PNG.png

if for some reason that doesn't work for you, you could always initialize the shift registers to inf and -inf as required

option 2 min max ave2.png

 

Message 4 of 5
(2,937 Views)

Thank you so much for your help sir, I confused lot to set the initial value, but now done with it. 

Thank you sir...

0 Kudos
Message 5 of 5
(2,930 Views)