LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

best data collecting practices

Solved!
Go to solution

Hello,

 

I am trying to find the best way of collecting about 5 seconds of data from a DAQmx Read vi at 1000 samples per second.  I want to be able to get the average, min and max from that collection.  I didnt think the best way would be all at once.  The best solution that I have come up with is in the jpeg below.

 

I also heard the term, "data stomping", and was told that is what I'm looking for.  Any thoughts would be appreciated.

 

Thank you in advance for your help.

 

P.S. I do realize concatenating the array output is not the best method due to reallocating the array memory on each loop.  I couldn't find a better method that served the same purpose.

Ron Deavers, CLD
0 Kudos
Message 1 of 4
(2,573 Views)
Solution
Accepted by topic author programmindragon

Hi,

 

Thank you for your post.  Since you are acquiring you data over a specific period of time, you will want to do a finite acquisition rather than using a while loop with your DAQmx Read.  I have attached a screenshot of what your block diagram would look like.  Also, using the Array Max & Min, Add Array Elements, and Array Size elements, you can find the maximum, minimum, and average values of your array.  Please let me know if you have any questions!

 

Regards,

 

Todd V.

National Instruments
Applications Engineer
NI Prototyping Community
Message 2 of 4
(2,519 Views)

Thank you for your help Todd.  That does exactly what I want.  I will make the appropriate changes.

 

I believe that an array is only limited by the amount of memory on the pc but what is a general limit that should be put into an array?  In this program, I have 4 of these inputs which means that I have 4 arrays of 5000 inputs each.  I was thinking that would be a bit excessive.

Ron Deavers, CLD
0 Kudos
Message 3 of 4
(2,482 Views)

Hi,

 

There really isn't a limit of elements that can be put into an array.  The programming implemented in the example that I posted previously should work great even with the number of arrays and array elements that you have.

 

Thanks,

 

Todd V.

National Instruments
Applications Engineer
NI Prototyping Community
0 Kudos
Message 4 of 4
(2,434 Views)