02-28-2018 09:59 AM
I am fairly new to LabVIEW and have never used a language like this. I am very experience in MATLAB and C programming, but need some assistance on this type of programming.
My issue is I need to capture the average of an array (mean) and place that constant into another array (see excel example). Once this is done, it will push the latest value down one index, and place the newest value in the index 0 position. I have tried many different methods and cannot seem to get any of them to work, or I may be using them all incorrectly.
Methods Used:
Decrementing
Auto-Indexing
Shift Registers
Any assistance will be of great help and if I need to clarify more, please feel free to ask. My looping structure may also be causing the problem, but I am not sure how that entirely works as well in LabVIEW.
Thanks in Advance
Solved! Go to Solution.
02-28-2018 10:14 AM
Your code is basically dead and just rattled down the wire in one shot. Where does the new data come from? Should the average be done over the last N points or over all points? (Sorry, I don't understand your excel file).
The FOR loop does not do anything. The sequence structure does not do anything useful, if you want to dealy the FOR loop, all you need is wire the output of the wait to the loop boundary.
The average of an array is hopefully not a "constant", but depends on the array.
Basically, all your data sources belong inside a loop if they should get re-read and you need to keep your new array in a shift register. Maybe ""mean ptbypt" would do what you want directly.
02-28-2018 10:23 AM - edited 02-28-2018 10:26 AM
Here is a quick example that could give you some ideas (maybe I misunderstood some specifications)
It will read the array of controls every 5 seconds and append the average to a new array.
02-28-2018 01:58 PM
That helped Immensely. I appreciate it. That was mainly my problem was keeping the old data, without having the new array rewrite it.
Thank you for the help.