06-14-2011 06:48 AM - edited 06-14-2011 06:49 AM
Hi All,
I would like to ask for advice for my 2 subVIs:
In my subVI I use the Mean point by point VI (Mean PtByPt VI, in my other subVI I calculate standard deviation, but its very similarly structured ). I give as an input a finite sample length, lets say 80. So I want to calculate the mean of the newest 80 elements. But I want to get the result first when the puffer is full, because I need good statistic. Since this VI starts to give result already from the first call, I need to workaround this. Should I hack inside this "system VI", or should I use an uninitialized shift register in my subVI next to this mean function, to see if I had already 80 calls or not?
thanks!
Solved! Go to Solution.
06-14-2011 07:10 AM - edited 06-14-2011 07:11 AM
I have decided not to modify the system function. I have attached my subVI, could you give me advice, if it is good, or not good approach?
(I call this subVI by passing it temperature values, and It should calculate if the temperature equilibrated yet or not, but only giving logical true output, when the sample length is reached)
Thanks very much!
06-14-2011 10:13 AM
It looks like it should work.
As you decided, it is not a good idea to modify VIs in vi.lib. Other code may depend on the the original function and at the next LV update all your work might be lost when the update replaces your modified VI with the one from the NI update. Any time you want to use a vi.lib VI as a starting point, first save a copy with a new name and new location, then modify that.
You could save a bit of effort by using the In Range and Coerce function. You need to change the input to not Include Lower Limit.
Lynn
06-14-2011 10:41 AM
Thanks very much for the advice!