From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Combine 2 1D array into 1D array with same size

Hi!

 

I  has tried to combine combine 2 1D arrays into 1D array with same size

 

But the result is not as my expectation 

 

So please help me!

 

Example:

Array 1      Array 2

1                A

2                B

3                C

 

Expected Array

1A

2B

3C

 

 

0 Kudos
Message 1 of 6
(1,159 Views)

You are best off posting the code showing what you have tried so that we can point out where you have gone wrong. (Post your actual VI not a screenshot)

 

You are basically going to want both of your starting arrays to be arrays of strings. Iterate through them in a loop where you concatenate them together.

 

 

0 Kudos
Message 2 of 6
(1,121 Views)

Here is my code. It is so messing.

I has tried to combine multiple 1 D arrays  into 1D by using Loop with concatenate string as below.

However, it seem not work as well for me.

 

KaSS90_0-1608804134146.png

 

0 Kudos
Message 3 of 6
(1,108 Views)

attached code 

0 Kudos
Message 4 of 6
(1,107 Views)

Can you save your code for 2019 or earlier (File/Save for previous version). Alot of us are always at least a year behind the latest version of LV

 

Can you also attach a copy of the data file that you are reading as it looks like a lot of your code depends upon how that is formatted.

0 Kudos
Message 5 of 6
(1,099 Views)

@KaSS90 wrote:

attached code 


Your code and attached image have nothing obvious in common with your question. You need to be more specific.

 

(Still, your attached code is extremely questionable: too many useless sequence structures. An event structure hidden deep inside other structures. Lots of Rube Goldberg code, especially with array operations, etc. You really should go over this with someone more familiar with LabVIEW)

 


@KaSS90 wrote:

I  has tried to combine combine 2 1D arrays into 1D array with same size

 

Example:

Array 1      Array 2

1                A

2                B

3                C

 

Expected Array

1A

2B

3C


 

To answer your original question, here's one possibility ("concatenate strings" inside a FOR loop):

 

altenbach_0-1608928519042.png

 

0 Kudos
Message 6 of 6
(1,058 Views)