LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Show list column in combobox

Solved!
Go to solution

Hello al,

 

Hope you're doing well!

 

I have a problem with array and I don't know how to solve it, I hope someone can help me. I have 5 text files, each one has three columns and several lines (example attached). I'm trying to use a combobox to display only the first column by joining all the rows of the 5 lists.

 

Sample lists:

 

Mocte117_0-1730236088292.png

 

I'm trying to make the combobox look like this:

 

Mocte117_1-1730236170086.png

... Adding the missing lines

 

My problem is that I don't know how to join several 2D arrays and end up with a 2D array with all the lists joined.

 

Mocte117_2-1730236238475.png

I can only show one list in the combobox, but I don't know how to join the other lists in the same combobox.

 

0 Kudos
Message 1 of 5
(226 Views)

Diagram pictures are a poor choice to demonstrate a coding issue and let's not complicate the problem with listboxes.

You have a couple of 2D input arrays and want to create a new array by selectively combining the inputs.

 

Please attach a simple VI containing the various input arrays as diagram constant and explain what you want.

 

Some glaring issues and questions:

 

  • "delete from array" is NOT the correct way to extract a column. Try index array with the bottom index wired.
  • Your combobox shows fewer items that available in the files. Do you want all?
  • Are you aware that "build array" can be switched to concatenate mode? (right-click)
  • Your NUM12 is in duplicate. Do you need to keep both?
  • How should things be sorted?

 

0 Kudos
Message 2 of 5
(209 Views)

See if this can give you some ideas. (We wire the lower index to get a column and built array is in concatenate mode):

 

altenbach_0-1730239484847.png

 

0 Kudos
Message 3 of 5
(196 Views)

Hello, thanks for checking my issue. I'm adding the VI and lists. I only want the combobox to display the items from the first row of the 5 text files. NUM1, NUM2, NUM3... NUM13. They don't need to be sorted alphabetically or in any other way, just that the items are displayed as they are read by the program.

Mocte117_0-1730242238919.png Mocte117_1-1730242270907.png Mocte117_3-1730242292539.png Mocte117_4-1730242313989.png Mocte117_5-1730242335706.png

 

 

 

 

 

0 Kudos
Message 4 of 5
(180 Views)
Solution
Accepted by topic author Mocte117

Why do you have so much duplicate code? Here's what I would do:

 

altenbach_0-1730245300740.png

 

Of course you could use "list folder" with LIST*.txt as pattern to generate the array of files.

 

Also:

Why do you have a greedy loop that cannot be stopped and reads the same files millions of time per second?

0 Kudos
Message 5 of 5
(166 Views)