I am trying to average sensor data by sending it to a sub vi i created, which will append an array within the sub vi every second, and then at the end of the set time, output an average over that time period and reset the array. For some readon some of my data values are coming out very wrong. Could there be someting wrong with this vi? Specifically, I am wondering if there is a problem with persistent data in the sub vi array.. I am running LabVIEW 8.5
Solved! Go to Solution.
You need to set you subVI to be reentrant. Go to VI Properties->Execution. There is a checkmark there for reentrancy. If you can choose, you want to preallocate clone for each instance.
What this will do is each call to the subVI will have its own memory space. It is currently sharing the memory space and therefore your averages are getting all messed up.
I would recommend visiting the LabVIEW Field Journal as there were some good articles this year on this subject matter.