04-23-2021 01:03 PM
Hello everyone. I have inherited the project attached, which I am completely redoing but using as reference to see how it was done before. The code in question is in the ac-dc-run.vi, which is a VI itself to the main project. The SubVI.zip folder contains 4 SubVI's that are called. This code is a mess and I'm trying to make sense of it. At the end you'll see there are 2 standard deviation functions that have auto-indexed inputs from the loop. Of course the idea there is to have a 1D array to output the mean, deviation, and variance. The loop iterations are set by the user, typically 8-14.
But are the inputs to the standard deviation functions even outputting the results of those 8-14 iterations? Or just the last iteration?
Solved! Go to Solution.
04-23-2021 01:21 PM - edited 04-24-2021 10:02 AM
(To make things easier for us, please place top-level and subVIs all inside a zip file next time. And there are still missing subVIs!). Whenever I see N=1 FOR loops, stacked sequences, formula nodes, and writing plaint tabular data as xls files, I get suspicions 😄
Since you are also trying to make sense of it, I assume you did not write this code. Do you know who did? Can you ask them?
You get one stddeviation for each frequency, but I don't really understand your question. Do you get a result that you don't expect?
Wouldn't it make more sense to output a 2D array where each row is a from a freq and the columns are freq, mean, deviation, and variance? Fewer cats to herd. 😄
04-23-2021 03:26 PM
@altenbach wrote:
(To make things easier for us, please place top-level and subVIs all inside a zip file next time. And there are still missing subVIs!). Whenever I see N=1 FOR loops, stacked sequences, formula nodes, and writing plaint tabular data as xls files, I get suspicions 😄
I get suspicions that parts of this code will be displayed on another thread when I see those things. 🙂
mcduff
04-23-2021 04:01 PM
Ok noted. There are so many other subVI's with this project that I didn't know if I should zip and post them. I'm a student and I've been working on this for about 2 months and as you can see it's kind of a wreck. You are correct, I did not write this. And no, the person who did is not available.
I see now that the while loop and tunnel index creates the array for the stddeviation function. That was my question. At first glance I thought the code was written incorrectly and the function was only receiving the last value, but it appears to be working how it should, albeit some questionable overall practices.
The new program works rather differently and compiles all of the cats in nice rows and columns. 😁
Thank you very much for your help.