LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a multicolumn list and format data, etc

So I have an application that looks like this:

http://i.imgur.com/4CXO6.png  (Couldn't get picture to post inline, sorry)

 

I want to replicate this in my program, because it gives me all the data I need, and is simple for the user to use. 

I made a multicolumn listbox, and it looks like this: 

http://i.imgur.com/AEGaS.jpg

 

I'm in LabVIEW 7.1

 

Is there another, better item to use than a multicolumn listbox for this? 

 

A couple additional features I want to add but am not sure how to are:

 

  • Being able to disable certain rows. For example, if a user's test only runs from row 1 to 5, I want the user to be able to select that, and then have the rows below blocked out so that its clear.
  • Ability to set limits to certain boxes. For example, negative values should be disallowed in some of the columns
  • Ability to read a line at a time as an array of ints. 

Suggestions?

0 Kudos
Message 1 of 8
(3,067 Views)

Bump.

 

Sorry to bump, I just really need a reply. 

The solution I've thought of is to just make a bunch of number boxes, but I see that geting extremely confusing very fast.

 

Thanks

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

I'm trying it manually with number boxes, the UI looks great, but... the code...

 

UI: http://i.imgur.com/ZojC8.png

 

Code: http://i.imgur.com/qJeey.png

 

As you can see, the code is looking... hideous and un-debuggable, even though I'm not halfway done. 

 

I'm hoping someone has a better solution, but until someone posts, I'm going to keep chugging away at this.

 

Thanks.

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

Hello bobholmgren,

 

I think your original idea of using a multicolumn listbox will work fine. I've create a simple VI that does the main things you wanted to do with the listbox, and you can feel free to expand on it. I use property nodes to read the data and disable individual rows.

Front Panel:

Listbox Front Panel.png

 

Block Diagram:

Listbox Block Diagram.png

 

If you wanted to continue using the number boxes, you could clean it up by making 5 numeric arrays instead of all the individual number boxes. Also you could store the number boxes in clusters to help clean it up as well. Let me know if you have any questions regarding how I made my VI. Best of luck!

 

-Nathan H

 

 

Software Developer
National Instruments
0 Kudos
Message 4 of 8
(2,963 Views)

Awesome, I'd love to play around with it (Its probably much better than my idea, which was the only way I could think of). 

 

I only have LabVIEW 7.1, do you think you could save that VI for 7.1? I tried to open it and it said I needed LabVIEW 10.

 

Thanks ^_^

0 Kudos
Message 5 of 8
(2,954 Views)

Hey, I've saved a copy for 7.1. The only function I didn't add that you requested was to set limits on values. This can be done by simply reading the values (using the ItemNames) converting them to numbers, and then checking for limits or negative. If you want it to auto-correct for this, you can just change any number outside of the limits to within the limits (i.e.-negating any value which is negative, so it just automatically changes it to positive) and then writing the changed value back into the ItemNames by first converting back to a string, and writing the row back into it's location. Good luck!

 

-Nathan H

Software Developer
National Instruments
0 Kudos
Message 6 of 8
(2,943 Views)

@Nathan H wrote:

Hello bobholmgren,

 

I think your original idea of using a multicolumn listbox will work fine. I've create a simple VI that does the main things you wanted to do with the listbox, and you can feel free to expand on it. I use property nodes to read the data and disable individual rows.

Front Panel:

 

 

Block Diagram:

 

 

If you wanted to continue using the number boxes, you could clean it up by making 5 numeric arrays instead of all the individual number boxes. Also you could store the number boxes in clusters to help clean it up as well. Let me know if you have any questions regarding how I made my VI. Best of luck!

 

-Nathan H

 

 


I'm curious what you meant about storing the number boxes in clusters.

0 Kudos
Message 7 of 8
(2,924 Views)

Hey,

 

A cluster allows you to put multiple controls or indicators in one location and route them through your block diagram as a single wire. For a more detailed explanation, please see this quick summary on how to set up clusters: http://zone.ni.com/devzone/cda/tut/p/id/7571 (cluster instructions begin about halfway through the article).

 

For what you are trying to do, I would still recommend using the multicolumn listbox. When using a cluster you would still have to unbundle/bundle it change items in it, and this may make coding your specific application tedious.

 

-Nathan H 

Software Developer
National Instruments
0 Kudos
Message 8 of 8
(2,895 Views)