LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert group of String fields to an Array?

Hello.

 

I am very new to Labview so please be nice.  Smiley Wink

 

I want to convert a group of string fields into an array and I'm not sure how to do this.  Ultimately when the program is complete, it should write data to a csv file and each of the fields under "Channel Description" should be written into a column at the top of the csv file.  From my search, I could do this with arrays instead of using a bunch of string fields but now all of my string fields are already configured and I don't want to have to go back through and rebuild all of that if just using some sort of "convert to array" would do the trick.  Any additional tips or advice is appreciated. Thank you.

0 Kudos
Message 1 of 4
(2,532 Views)

You should still use "built array" to create an 1D array of strings, wrrite it to the new file, then append the 2D data array to the file.

 

You really should have made it an array control, dramatically simplifying the code and front panel.

0 Kudos
Message 2 of 4
(2,515 Views)

@altenbach wrote:

You should still use "built array" to create an 1D array of strings, wrrite it to the new file, then append the 2D data array to the file.

 

You really should have made it an array control, dramatically simplifying the code and front panel.


If using an array control works better and cleaner, I guess I can go back and redo the front panel.  However, will I still be able to size the fields and format them the same way that I currently have my string fields??  I will need to write the "Engineering Units" to a columns in the csv as well.  Currently I have the Engineering units as a drop down control.  I like it that way but if using an array control works better and simplifies the code much more, I suppose I can change that part too.

0 Kudos
Message 3 of 4
(2,506 Views)

You can always make an array of clusters if you want to keep that piece the way it is.

 

The way you have it now is going to be a mess to wire into anything else.  With the array, it's one wire to transport the entire data set.  I'm hoping all of those dangling nodes on your block diagram are due to an unfinished program.  Generally speaking, you don't want anything dangling freely on the block diagram.

0 Kudos
Message 4 of 4
(2,474 Views)