LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display moving average in XY Chart

Hello Everyone,

Im trying to produce an XY Chart for Time vs Pressure.
What I would like to do is also plot a moving average on the Chart. Can anyone suggest an example on how to do this?

Thanks
0 Kudos
Message 1 of 2
(3,360 Views)
Hello David,

at the moment I only find a XY Graph in my control palette, but no big difference:
You can display more than one plot by building a cluster of plots (see the help window for the XY Graph). So you have to build two plots (pressure over time and average over time) and join them with a Build Cluster. Wire that to the XY-terminal. That's it.
For calculating the moving average: build an array of your measurement values and get the last x elements. Calc the average of those elements. If your measurement runs in a loop, you can use shift registers instead of building an array (depends on how many elements you want to include in your average).

Best regards,
GerdW
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 2
(3,360 Views)