LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

shift register array

Solved!
Go to solution

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

0 Kudos
Message 11 of 15
(1,866 Views)

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

0 Kudos
Message 12 of 15
(1,855 Views)

Good.

 

If you would like us to comment on your code, please post the VI.

 

Lynn

0 Kudos
Message 13 of 15
(1,851 Views)

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. 

0 Kudos
Message 14 of 15
(1,842 Views)

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. 

 

 Appended array.png

 

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

0 Kudos
Message 15 of 15
(1,823 Views)