LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing values of array with every iteration

HI,

I want to add to every element of the array with every iteration of the for-loop. I have attached the program that I have created. Whenever I run the program I get the output as an array with every element in it having value '0'. How do I solve this problem?

0 Kudos
Message 1 of 2
(1,718 Views)

You need to initialize your array.

 

You are not getting an array where every value is zero like you say you are.  You are actually getting an empty array.

 

Your shift register is initialized with an empty array.

When you multiply an empty array by i, you get an empty array.  When you add an array to an empty array, you get an empty array.

 

Move your array control outside the loop, multiply it by zero, and connect that to the shift register.  Now you'll have an array to start that is filled with zeroes and is the same size as your array control.

0 Kudos
Message 2 of 2
(1,709 Views)