LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with "simple" array concatenation.

Hello 2 all !

 

I have a problem with concatenating two arrays using a FOR loop. 

 

Please see the attached vi.

 

I've searched the forum but i can't just make it work.

 

So...any advice about where the problem could lie, is more than welcomed.

 

THE DATA IS GENERATED AUTOMATICALY WHEN YOU PRESS "CALCULATE".

 

Here is the problem :

 

ARRAY 1:     ARRAY 2:    DESIRED RESULT :

 

 0                  0                 0

-4                  0                -4

 2                  0                 2

 0                  0                 0

 7                  11               7

-4                  6                -4

                                        0

                                        0

                                        0 

                                        0

                                        11

                                        6

 

Thank you very much!

Message Edited by Andoro on 03-18-2010 12:48 PM
Message Edited by Andoro on 03-18-2010 12:50 PM
0 Kudos
Message 1 of 10
(3,550 Views)

Hi Andoro,

which array do you mean? Can you explain what your vi should do?

 

Mike

Message 2 of 10
(3,544 Views)

Hello !

 

So...when you press the button "calculate", two array are generated, which contain the results of some calculations.For each iteration of the for loop, some results are stored into those arrays.

Two arrays are generated "direct-g22_1" and "invers-g2_1".

 

I want to concatenate those two array's into the "test" array.

 

Example : Concatenate the results stored in the  "direct-g22_1" and "invers-g2_1" arrays into the "test" array for each iteration of the for loop.

 

 

 

 

 

0 Kudos
Message 3 of 10
(3,537 Views)
And start by rewriting the VI to get rid of each and every local variable. Then use proper datatypes. You are mixing DBL and I32 types and don't seem to be aware of some of the consequences (i.e. checking for equality on a DBL).
Message 4 of 10
(3,534 Views)

You can concatenate two arrays by using the Build Array function, right clicking, and selecting "Concatenate inputs".

 

I can't tell what you are trying to in in your VI.  And I really suspect that a lot of your problems may be cause by your use of local variables leading to race conditions.

Message 5 of 10
(3,531 Views)

see if this is what you are looking for

 

Andy Chang
National Instruments
Message 6 of 10
(3,531 Views)

Thank you all for answering my post !

 

I'm using LabView 8.5.

 

The last attached vi doesn't seem to work.

 

Can you please post a picture or convert the vi to LabView 8.5 ?

 

Thank you very much !

0 Kudos
Message 7 of 10
(3,525 Views)

Here it is again

 

Andy Chang
National Instruments
Message 8 of 10
(3,522 Views)

Thank you AndyC !

 

I've tried this approach, but it isn't correct.

 

Trully, it concatenates the arrays, but each arrays is reapeated at least two times in the "test".

 

The desired output should be :

 

0

-4

 2

 0

 7

-4

0

0

0

11

6

3

-2

1

3

9

-5

3

-9

-5

3

2

1

 

Thank you 4 your patience !

0 Kudos
Message 9 of 10
(3,517 Views)

ah i see. It was a bit difficult to work with your VI, but I hope this would help.

example.PNG

Andy Chang
National Instruments
Message 10 of 10
(3,479 Views)