LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Summation of Arrays

Hi there,
I'm using a buffered acquisition to take 20 samples of the same signal, average them and output them to a spreadsheet.

I'm using a while loop to cycle through the 20 samples and I thought I could use shift registers to sum the arrays, and then divide before outputing to a spreadsheet.

The acquisition works fine without the summation.

I can get everything to work except the summation. I tried adding the data coming out of the analog acquisition VI with the 'left' shift register (outputting the summation to the right shift register) and then output the sum to file out. File output is outside of the loop. For some reason, this is not working. I also tried wiring the right shift register to file out. This also
proved unsucessful. Is there anything odd about shift registers that I'm missing?



Much thanks, your help would be appreciated.
0 Kudos
Message 1 of 2
(2,831 Views)
Perhapse you are not initializing your shift register (wiring in a value to the left side, before the loop executed). Also, the easiest solution would be to wire the data, as it comes from your DAQ read function to a tunnel (the wall of the while loop). Right-click on the tunnel (black box) and enable indexing. This will build an array of data at the tunnel. Then wire from the tunnel to the Add array elements (Sumation) function, outside of loop.

-Jim
Message 2 of 2
(2,831 Views)