LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String Array to Cluster Element Name

Solved!
Go to solution

Good Day,

 

I'm trying to take a string array and convert the values into cluster element labels. I would like this to be auto indexed so the cluster size is dependent on the array size. The cluster is then unbundled by name used for a dialog box to prompt the user for information. I can go from a cluster and get an auto indexed array of names, I'd like to do the opposite. The end goal is that first the cluster name is written to a .csv file and the next row is the user data. I want this to be done dynamically with only an array or comma separated string.

 

I'm including some forum posts that are similar, but I am unable to fit their solution for my purpose. I've also attached some VI's that show what I'm trying to do.

 

I hope I've been clear and thank you for any help,

 

-Matt 

 

Solved: How to convert an array of string elements to a cluster with named elements of different dat...

 

Solved: array of strings + array of numbers ?= cluster of numbers with names - NI Community

0 Kudos
Message 1 of 4
(150 Views)

Many years ago (maybe 10-12?), I did something similar.  We were using an Excel Workbook to save "testing" data, where the Rows were individual Trials and the Columns were both the "instructions for the testing paradigm" (these were behavioral tests, where we played sounds, flashed lights, moved items around) and the place where we recorded the subjects' responses (including timing and analog data for such things as hand orientation).

 

I'm not sure I'd do it this way now, but we built a "Super-cluster" that corresponded to an Excel Row.  The Good News is that once we built the Master Spreadsheet, we could design the SuperCluster, and we were "good to go".  The Bad News is after a few months, one of the students would come and say "Can we add Headphones to the experimental paradigm?".

 

To keep everyone (especially me) sane, I wanted a way to "look at the Spreadsheet" (which had Column Labels that, naturally, identified the Column Data) and create a SuperCluster.  How to do that in LabVIEW?  LabVIEW Scripting!  This is an example of using LabVIEW to analyze some data (in this case, I analyzed my "Master Excel Workbook" and get it to write LabVIEW code for you (in this case, it created the Cluster TypeDef.

 

That was a long time ago -- I'm not even sure I have the code around anymore -- I get nervous even thinking about it.  But it did work ...

 

Bob Schor

0 Kudos
Message 2 of 4
(123 Views)

Wouldn't be a Map the right datatype to solve this problem?

Greets, Dave
0 Kudos
Message 3 of 4
(117 Views)
Solution
Accepted by topic author Singus

You mean like this?

"If you weren't supposed to push it, it wouldn't be a button."
Message 4 of 4
(86 Views)