LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Concatenate 2D array values into a 1D array

I have a 2D array see example below:

C1 C2 C3 C4

A 1 1 2
2 2 3
3 3 4
4 5
5 6
7

I want to create a 1D array that looks like this:
A112
A113
...
A117
A122
A123
...
A127
...
A312
...
A357

I can't seem to figure this out. Any suggestions. I am using LabVIEW 6.1.
0 Kudos
Message 1 of 7
(3,031 Views)


@kmastro wrote:
...I can't seem to figure this out...


Nor do I !
I spent 5 mins trying to understand your question, without success. I guess the C1 C2 C3 at the top stand for column 1, column 2...; But I'm puzzled on the meanings of the lines bellow : apparently A112 is a single element that will be the first element of the 1D array you want to build. So where is the second element in the 2D array (line 1 column 2) ?
Are you trying to create alphanumeric strings from a 2D array of single chars ? How do you intend to go from A127 to A312 ?

Try to make things more clear if you wish to receive some help...

CC
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 2 of 7
(3,025 Views)
Yes, I am trying to make an alphanumeric string.

Column 1(C1) has one value 'A' this will be in location Column1 Row1 (C1R1),
Column 2 (C2) has multiple values, let me use 4 values '1,2,3,4'
1 (C2R1), 2 (C2R2), 3 (C2R3), 4 (C2R4)
Column 3(C3) has multiple vaules, let me use 6 values 'BB, CC, DD, EE, FF, GG'
BB (C3R1), CC (C3R2), DD (C3R3), EE (C3R4), FF (C3R5), GG (C3R6)

I want to create a string like this:

C1R1 C2R1 C3R1 = A1BB
C1R1 C2R1 C3R2 = A1CC
C1R1 C2R1 C3R3 = A1DD
C1R1 C2R1 C3R4 = A1EE
C1R1 C2R1 C3R5 = A1FF
C1R1 C2R1 C3R6 = A1GG
C1R1 C2R2 C3R1 = A2BB
C1R1 C2R2 C3R2 = A2CC

This will continue unitl the final string is created A4GG

The first value will stay the same A, the second vaule will change only after the last value it the couln following is completed.

Please let me know if this is easier to understand.

Thanks for the help.
0 Kudos
Message 3 of 7
(3,015 Views)
If you know you will only have 3 columns, the fastest way is probably to hard code it using a for loop within a for loop. Use a shift register to keep the 1D array, something like this.

___________________
Try to take over the world!
0 Kudos
Message 4 of 7
(3,008 Views)
It is still not clear if you simply want a single multiline output string or an array of strings.

The attached VI (LabVIEW 7.0) should give you some ideas.
0 Kudos
Message 5 of 7
(2,999 Views)
Could you make a screen copy of your program? I have LabVIEW 6.1 and can't view 7.0.

Thanks
0 Kudos
Message 6 of 7
(2,958 Views)
Here's the LabVIEW 6.1 version. Enjoy. 🙂
0 Kudos
Message 7 of 7
(2,953 Views)