LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use listbox to select multiple channels and display on the graph

Solved!
Go to solution

Hello everyone!!!

I have a problem using listbox in selection mode 1 or mode items. I have 6 channels data and I have a 2D array. I am able to reterieve the names of signals in listbox but I want to be able to choose one or more signals to display on the graph. I have used index array to which my 2D data is connected and then the output of index array is connected to graph. I was to use listbox as an index for the index array and display the selected index data to display on the graph. I have used property nodes of lisbox like value, active row and all but not able to display the signals on the graph. I have attached a sample code to show you what exactly I am looking for.

 

Any suggestions will help me a lot.

0 Kudos
Message 1 of 13
(6,562 Views)

You can just use index array with the values from the listbox. The first loop is just to create the data, which you say you already have. The second loop just takes it from the array.

 

Display from listbox.png

0 Kudos
Message 2 of 13
(6,539 Views)

Gregory I tried it but it does not shows me correct data. It is not showing me all the channels. I want to choode more than one and show them on graph. 

0 Kudos
Message 3 of 13
(6,539 Views)

As you can see from my snippet, it does exactly what you are describing "I want to choode more than one and show them on graph."

 

Please list the exact steps you are going through and I will try to reproduce your error or catch your mistake. If you have questions about code please post a snippet (select your code and press Edit >> Create VI Snippet from Selection) or a LV 2012 VI for me.

0 Kudos
Message 4 of 13
(6,537 Views)

Here you go gregory!! This is the sample code in Labview version 2012. Yes, the code you provided does work but it does not show the correct data to me. When I choose ring menu it is showing the right information but with listbox it is not.

0 Kudos
Message 5 of 13
(6,535 Views)

Your VI was not executable, even the initialize array function had missing inputs. You must refer to the help for functions if you have not used them before. In the end, you just need wire it up exactly as I showed you before. The way you have it coded right now, you must run it once to populate the listbox names. Then make your selection (ctrl+m will go into "locked" mode), then run again.

 

Display from listbox2.png

0 Kudos
Message 6 of 13
(6,532 Views)

When I used the code you provided me it shows the data based on number of items selected from listbox. For example, if from the listbox I chose 2 items it shows me 2 samples of the graph i.e. only two points not the whole signal. So, somehow it is not showing the right information. It is shown in the picture.

0 Kudos
Message 7 of 13
(6,521 Views)

Pay attention to which input you use for "Index Array". If you have your channels arranged as rows, use the first (row) input. If you have them arranged as columns, use the second (column) input. 

0 Kudos
Message 8 of 13
(6,518 Views)

Also, the another problem is when I put index array inside the for loop like you suggested, there is no option for row and column on index array block. They both say index when my 2D array is connected. But when I used the ring menu it says row and column. Don't know why it is different.

0 Kudos
Message 9 of 13
(6,516 Views)

I'm sorry, I don't understand the distinction you are making. Please post a picture of the problem you are seeing

0 Kudos
Message 10 of 13
(6,512 Views)