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 10
(201 Views)
Solution
Accepted by 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 10
(193 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 10
(187 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 10
(184 Views)
Solution
Accepted by 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 10
(165 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 10
(132 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 10
(111 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 10
(99 Views)

LabVIEW Tutorial

 

It will take you a few minutes to go through the first part of this basic tutorial and you will understand the basics you need to know. 

 

It's really amazing that you were able to piece together such a complicated way to do this task as a newbie!  It CAN be done that way and there ARE reasons to do so, but they are for much more advanced architectures.  I suspect it won't be long until you are on that level though.  Are you coming from other language(s) that lead you to use references right off the bat???

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 9 of 10
(21 Views)

I can't believe I missed this tutorial, appreciate this!

I also appreciate your kind words of encouragement! I studied Computer Science almost a decade ago but never really used the knowledge or practiced until now. My...less than ideal google searches lead me to believe this "invoke node" was the way to go and I foolishly never looked back!! Until of course the fantastic community let helped me out.
Thanks again everyone

0 Kudos
Message 10 of 10
(8 Views)