06-26-2015 07:34 PM
Actually you need to remember the sum of some elements rather than the individual values.
I have written a version that works without using Index Array. It uses shift registers and will work for any input array of at least three elements.
I have another version which is also scalable and which requires no loops and shift registers. I have tested both with 5000+ element arrays and get identical results.
Lynn
06-26-2015 07:40 PM
Thanks. I did get it to work with your hints. I built the indexed array as you originally showed without the shift register, then passed the 2nd and 3rd elements to the shift register, added a second and third element so the sum would be passed two more times, then built the output array. I may try tinkering with it more to allow for any size arrays but for now I got it to work with any 6 element array.
Thanks again
06-26-2015 07:42 PM
Good.
If you would like us to comment on your code, please post the VI.
Lynn
06-26-2015 07:58 PM
Actually I am testing it, and it is not quite doing what it should, but it is close. Here is the code if you could give me a hint on what I did wrong.
06-26-2015 08:13 PM
Turn on Highlight Execution (the light bulb on the block diagram toolbar) and watch what the VI does.
Expand the appended array on the front panel. Is that what you want? It is the result of autoindexing at the output tunnels of the for loop.
Reading the Array indicator and indexing the six values out on multiple iterations of the loop when it does not change between iterations is useless and redundant.
Look up "uninitialized shift register" in the Help.
Lynn