LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to plot average of data while its being acquired

"Please help. I am acquiring data at 1000Hz. The user enters number of points to average. The running average will then be plotted. I am having a problem of not being able to plot the data fast enough. Say I collect 5000 data points at 1000Hz. I only want averages of every 10 points plotted, meaning I'd have 500 points.

I am attaching a diagram to maybe better explain what I'm talking about. It shows what will need to be inside of my while loop, because data is acquired as long as the while loop is going.


I cannot figure out how to do this!


Thanks for your suggestions!
Lauren"
0 Kudos
Message 1 of 2
(2,692 Views)
uscmagz,
If you are using LabVIEW 7.0 or later, you can use the "Sample Compression" express VI. It can be found under Sig Manip>>Sample Compression.

If you are using something older, you will have to manually program it yourself. Attached is the diagram for code that will give you an idea of how to do it.

Hope it helps,

Jack J.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,692 Views)