LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing data to Array in SubVI

Solved!
Go to solution

Hi all, first time poster and newbie to LabVIEW.
I am trying to do a simple task of getting data from a multicolumn list-box control to show up in a subVI.

When I attempted this with a Numeric control, I was able to get the data into the subVI control successfully.

However, when I attempted with my multicolumn list-box it was unsuccessful.

 

I am attempting to do use itemNames which is a 2d array.
The control itself is a 1d array of long, which I believe is the issue.

However, I am not sure how I can resolve this.

 

Thank you in advance!

Download All
0 Kudos
Message 1 of 8
(159 Views)
Solution
Accepted by topic author jyoo221

Why do you make it so hard on yourself?

 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Download All
0 Kudos
Message 2 of 8
(151 Views)

Hi Jeff,

 


@jyoo221 wrote:

I am attempting to do use itemNames which is a 2d array.
The control itself is a 1d array of long, which I believe is the issue.

However, I am not sure how I can resolve this.


You need to distinguish between the value of the multicolumn listbox (MCLB) and its properties (like ItemValues)!

From the MCLB terminal you can only read the values, which reflect the selected rows.

When you need the ItemValues then you need to use property nodes of the MCLB…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 8
(145 Views)

@Yamaeda wrote:

Why do you make it so hard on yourself?

 


+1.  If you are new to LabVIEW, start with a basic tutorial and learn how to wire these controls properly.  When you've mastered that, then play around with external VIs, Variants, Invoke Nodes, etc.  

 

Where did you even learn how to do this stuff as a "newbie"???  🤔

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 4 of 8
(142 Views)
Solution
Accepted by topic author jyoo221

You need to pass the properties (ITEM NAMES) of the list box from the main vi into the properties to the Subvi control. 

If you want to do it from the main vi, then you need to get the reference of the control from the subvi and then write the ITEM NAMES properties. 

 

LVNinja_0-1732633046413.png

 

Message 5 of 8
(123 Views)

Would you believe that I am just that inexperienced? I just started learning labview and my mentor has been unavailable recently.
I figured I would try my best while he is unavailable. Sorry you guys got caught in the crossfire, but I didn't want to sit around doing nothing!
my research suggested I try using invoke node.

Either way, I appreciate everyone's input but is there some material I can read up on the about Yamaeda's solution and why this works?
From my understanding the property node is feeding into the SubVI, but how does the SubVi's Item Names 2d array become populated?

The labels are technically different as well.

 

Again, thanks in advance! 

0 Kudos
Message 6 of 8
(90 Views)

Thanks all!

After going through subVI I realized I was able to use the connection pane to determine which input would associate with which control.

Thanks again for the patience and assistance

Message 7 of 8
(69 Views)

@jyoo221 wrote:

Thanks all!

After going through subVI I realized I was able to use the connection pane to determine which input would associate with which control.

Thanks again for the patience and assistance


Yes, that's how you make SubVIs in general, and also how all VI's are/can be SubVIs. 🙂

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 8
(55 Views)