11-01-2022 03:35 PM
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.
Solved! Go to Solution.
11-01-2022 03:51 PM
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?
11-01-2022 07:36 PM
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
11-01-2022 07:55 PM
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
11-01-2022 09:47 PM - edited 11-01-2022 09:51 PM
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?
11-02-2022 12:16 AM
See if this can give you some ideas
(not attaching the VI since you seem to prefer pictures)
11-02-2022 08:41 AM - edited 11-02-2022 08:43 AM
@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. 🤔
11-02-2022 09:18 AM
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.