04-12-2007 08:52 AM
I may be misinterpreting on what values you want to average. When I looked at your original VI, I saw you were sweeping from 0 to 11 on the current, then back down to -11, up to 11, down to -11, on and on again. (The code in the lower left of your loop was a little confusing, but I assumed that was something you just put together to get the sample sweeping.) I figured that you want to average in all of the voltage y values that occur at a particular current x value. So after 4 sweeps, you have 4 different voltage values at +5A, you want them to be averaged into a single value.
I am looking at the arrays as a set of "bins", so index 0 might hold the sum of all the -11A values, index 1 would hold the sum of all the -10A values. The index used for these arrays is to track each value into its appropriate bin. This would not be the same as the index of your master loop where you have thousands of iterations of the loop to track hundreds of different data points for each of the dozen or so bins. So you will have to use that "x" value that is going into the graph in some way to translate that to the array index being used in the sub-VI.
04-12-2007 12:03 PM