From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pass listbox NAMES to subVI

Solved!
Go to solution

Hello,

In the attached main VI (main2sub), how do I going about passing the names of the listboxes from the MIAN VI to the the subVI?

 

Thanks,

hiNI

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

Use the ItemNames Property.

 

mcduff

snip.png

 

 

 

 

Message 2 of 8
(3,470 Views)

Do you have to unbundle then bundle each element in the cluster then pass that to the subVI?

 

Thanks.

0 Kudos
Message 3 of 8
(3,458 Views)

The names come out as an array of strings.

 

You can pass the array directly into your subVI, or you can pass a reference from the listbox to your subVI and use the property ItemNames in the subVI.

Snap8.png

 

 

Snap9.png

 

 

 

Maybe you can better explain what you want. A listbox may not be the correct control, maybe just use an array instead.

 

mcduff

 

mcduff

Message 4 of 8
(3,454 Views)

The premise is that this listbox is used as a selection box for inputs into the subVI.  This listbox is created from parsing repeated data.  Each new dataset creates an input into the listbox.  After the listbox is created, I can then go and select one or more input to generate plot data.  Here is a screenshot of my main VI:

 

Capture.PNG

 

I can then go and select one or more rows from either the "Temp", "Test Condition" or "LO Freq" and the idea is to get the plots accordingly...

 

I tried this option:

Capture.PNG

but could not get the names to appear in the subVI.

 

Is there a way to have the full cluster pass through to the subVI?

 

 

0 Kudos
Message 5 of 8
(3,400 Views)

Hi hiNI,

 

I tried this option: but could not get the names to appear in the subVI.

Is there a way to have the full cluster pass through to the subVI?

- You already wire the "full" cluster to the subVI - why use an additional reference too?

- When you use a reference for the cluster you need to read the cluster element references first. Use them to read the content of those listboxes…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 8
(3,395 Views)
Solution
Accepted by topic author hiNI

No, listboxes do not pass the names.

 

You can try something like this.

snip2.png

 

 

 Edit: GerdW beat me with words.

 

Download All
Message 7 of 8
(3,394 Views)
Solution
Accepted by topic author hiNI

You might also be interested in going through the list of selected items, and only returning the ones the user choose, and only pass that into the subVI.

 

Example_VI.png

 

Also if you are looking for allowing a user to select multiple items from a listbox, I would suggest you look into some code I posted here, which allows for item selection by clicking checkboxes in a listbox, multicolumn listbox, or tree.  What is returned is the array of items selected as tags.

Message 8 of 8
(3,385 Views)