LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sum window array

Solved!
Go to solution

Hello everyone,

I need some help creating a sum window on an array. For example, Im trying to make a summing window of 5 elements moving throught an array of 10 elements.

The attached .vi only works for the first 5 elements and I need to move throught the 10 elements point by point.

Thanks for any help or suggestion.

 

 

 

 

0 Kudos
Message 1 of 4
(3,317 Views)
Solution
Accepted by topic author Alvaro_Ortiz

One thing that jumps out to me is you're never updating the index on Array Subsets.  You've wired a constant 0 to the input.  This, of course, means that every iteration of the loop gives you elements 0-4.  Try wiring the i terminal to the index inputs.

--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 2 of 4
(3,316 Views)
I'd add that you probably want to index the result of your summation so you get an array of sums of the selected length of elements.  No?
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 3 of 4
(3,299 Views)

Elset, you were right .. I just need to connect the index of the for loop to the array subset to update the values and that was all ... sometimes you just keep giving turns around on a simple solution ..

 

I am going to attach the solution if somebody have something different or see something wrong just let me know.

 

Thanks ..  

0 Kudos
Message 4 of 4
(3,283 Views)