LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to combine 2 different 1D array types

Solved!
Go to solution

Hello,

 

 

I am trying to combine a 1D array of values(using a local variable) which is already in double format with a 1D array of string. How can I do this? Is there a vi or function in labview that can do this? 

 

I hope to eventually transpose the resulting array.

 

 

array2.PNG

0 Kudos
Message 1 of 8
(2,362 Views)

Convert your numeric to formatted strings. (Since you cannot convert your string to numbers)

Create a 1D array of clusters, each element having a numeric and a string.

etc.

 

Where are the terminals?

What do you want in the end?

0 Kudos
Message 2 of 8
(2,356 Views)

In the end, I want to transpose the 2D array( combination of the 2 arrays) and connect the output to a 'write to a spreadsheet'. I would like to open the resultant array in an excel sheet

0 Kudos
Message 3 of 8
(2,314 Views)

It looks (to me) like you have 13 Floats and 13 Strings that "name" the Floats.  LabVIEW has something called a "Cluster" that lets you combine "related things", like the "Name of a Quantity" (a string) and the "Value of a Quantity" (a Float).

 

Create a Dbl, call it "Value".  Create a String, call it "Name".  Find the Cluster under "Data Containers" on the Front Panel.  Make it big enough that you can place the "Value" and the "Name" inside it.  It is now a "composite Control" or "composite Indicator".  You can find Help for the Cluster by using the LabVIEW Help, or going to Google and saying "LabVIEW Cluster" and doing some reading.  You can now make an Array of these things, and the Name will go along with the Value.

 

Bob Schor

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

From the code fragment, we can tell that you are a beginner an we are here to help. As a first step, attach your vi.

 

Solving this problem is trivial.

 

Why is there so much code instead of a string array constant.

 

Your term "transpose" makes little sense. I assume you want two columns, right?

0 Kudos
Message 5 of 8
(2,282 Views)
Solution
Accepted by topic author chudoe

See if this can give you some ideas

 

 

altenbach_1-1667366148727.png

 

 

 

 (not attaching the VI since you seem to prefer pictures)

Message 6 of 8
(2,261 Views)

@Bob_Schor wrote:

It looks (to me) like you have 13 Floats and 13 Strings that "name" the Floats. ..

 

Bob Schor


Too bad there wasn't a way of using the name of the Floats instead of creating a string with the same name. 🤔

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
Message 7 of 8
(2,226 Views)

Yes, this worked! I wanted to create 2 columns of data instead of 2 rows. Thank you!

I didnt add the vi because its has proprietary work data.

0 Kudos
Message 8 of 8
(2,219 Views)