02-24-2010 04:49 PM
Hi,
I am creating vi to show last 100 values on one chart and average of each ten values on another chart. So when 100 values are acquired on first chart, the ten values ( where each is average of 10) are displayed on another. The code I have created for this purpose is attached.
I dont think I have achieved what I started for because:
X axis is time in seconds rather than number for every value unless there's one value acquired every second.
If I switch on highlight execution, the average display chart wait until first 10 values are displayed on waveform chart. It should then display a single average value. It should do it for every ten iterations. However, it is not the case.
Could anybody please modify the code for me and advise on modifying x axis from time to any other variable when necessary.
Many thanks in advance for help
Solved! Go to Solution.
02-24-2010 05:09 PM
Hi,
In the code, you are doing moving window. However, from what you are describing, you want a fixed non-overlapping window. I changed the following, see attached code.
1. I change the x-axis from time to point.
2. I put the 2nd chart in a case structure. The 2nd chart will only update when the loop iternation is divisible by 10. Let me know does this work for you.
Yik
02-24-2010 05:57 PM
Thanks mate
I changed label from time to point and added case loop as in your code. This is exactly what I wanted
Thanks
02-25-2010 04:25 AM - edited 02-25-2010 04:29 AM
Hello. But what if you want to control the number of data points averaged a change it during program running? Or what if you would like to average each data point with 5 points from the left and 5 point from the right? I have no idea how to to it. Ivan
02-25-2010 06:13 AM