09-11-2012 06:11 PM
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.
09-12-2012 07:18 AM
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.
09-12-2012 10:46 AM
That fixed it right away. Great work, thank you!
12-11-2013 02:53 PM - edited 12-11-2013 03:17 PM
thanks