LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Associating Signals from Listbox Selections for Plotting

Hello, I want to give the user the choice to select the signals they want to plot among 6 acquired signals; I have created a listbox of the names of these signals but I don't know how to associate each name with a signal.

The user can choose multiple signals from the 6, and I would like to plot them on the same graph.

 

Can you help me?"

 

0 Kudos
Message 1 of 5
(252 Views)

Hi Amelie,

 


@ameletudiante99 wrote:

Hello, I want to give the user the choice to select the signals they want to plot among 6 acquired signals; I have created a listbox of the names of these signals but I don't know how to associate each name with a signal.

The user can choose multiple signals from the 6, and I would like to plot them on the same graph.


The listbox gives you an array with the indices of the selected items (in multi-selection mode). You can use those indices to index your plots for the graph…

 

Maybe it's a good idea to attach your approach on this problem?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(221 Views)

Yes, that's what I want to do; but how can I index a graph? I want to make each index correspond to a graph? but I don't know how it's possible given that the index list of my listbox can contain several elements, I thought of a structure box but I can't come up with this case

thank you for your reply

0 Kudos
Message 3 of 5
(210 Views)

If your signal is in a 2D array of numbers, where each signal is a row of the 2D array, you can use the list box as the index of the 2D array. using the function Index Array to select the row of your signal and plot on a graph. 

LVNinja_0-1717770183456.png

 

0 Kudos
Message 4 of 5
(206 Views)

If you are using a multiple listbox, the outpub is an array of indexes, then you need to add a for loop to select only the only the selected channels and plot all together

LVNinja_0-1717770503513.png

 

0 Kudos
Message 5 of 5
(201 Views)