LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Iterative addition of 2D array using a shift register

Hi
I'm trying to add 2D array iteratively using a shift register.
However, the indicator for the output of 2D addition shows nothing.
Do you know Why? and How to fix this problem?
 
Thx
hiyang
0 Kudos
Message 1 of 8
(6,324 Views)

I'm sorry

I didn't put the file for this.

 

0 Kudos
Message 2 of 8
(6,311 Views)

Hi Hiyang,

sorry, could not understand your query.

are you adding all individual elements of a 2D array to get a single sum?

If it is so, here is a simpler method to do it, use add array elements function in numerics palette( look at attached VI)

or,  are you adding two seperate 2d arrays?? again use addition function for acheiving it (as shown in the same VI)

Regards

Dev

 

 

 

0 Kudos
Message 3 of 8
(6,310 Views)

Ok, looked at ur attached VI

You are not getting any output because, you are adding an array with an empty/blank array

First, initialise an array of zeroes of required size and pass it to shift register,  Initialise your other array which u are adding inside the loop also of similiar dimension, and later, keep changing its elements

Do as shown in modification of your attached VI

Regards

Dev

 

 

 

Message 4 of 8
(6,307 Views)

Thank you Dev.

It does work well when I follow your suggestion.

Again thank you Dev.

0 Kudos
Message 5 of 8
(6,300 Views)

Hi!

 

How You make then the output array in both cases ... my way is not working .... Smiley Sad

 

Thanks!

0 Kudos
Message 6 of 8
(5,748 Views)

You should have create a new message thread for your question instead of posting into a 6 year old one.

 

The problem is you are using insert into array, and doing it on an empty array, after the first iteration, you are trying to insert into row 1 of an empty array, but row 0 doesn't exist, so you wind up with an empty array.

 

If you are trying to build up an array of results, you need to keep that array in a shift register instead of starting with an empty array on each iteration.  You should also use build array instead of Insert into Array.  (Insert into Array is almost always incorrectly used.  Build array is the correct function to use about 99% of the time.)

0 Kudos
Message 7 of 8
(5,736 Views)

Hi!

 

Thank You for the reply... could You please send me solution in VI file .... 

 

I could not completely understand your solution Smiley Sad

 

This is part of the solution, which is dedicated for the arbitrary step function into Control and simulation ....

 

Thank You !

 

 

0 Kudos
Message 8 of 8
(5,721 Views)