LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multicolumn Listbox, Property Node and Value property arrays

Solved!
Go to solution

I'm trying to tidy up a common use case I have with MCLs into a nice reusable utility VI, where I'd like to allow the user to select zero, one or more items from one MCL and transfer the selected contents to another MCL. The easiest way of doing this is passing a reference to my source and destination MCLs to the subVI and then accessing the Value and ItemNames properties.

 

However...property nodes for strict MCL types return a Value property equal to a scalar I32, rather than the array of I32s I need for 0 or more selection modes.

 

There are a couple of approaches I can use here:

 

- Pass in the control value array from the calling VI

- Disconnect the datatype from the control, meaning Value returns a variant, then Variant to Data to the I32 Array

- Set the reference type to a generic control, then do the above

- Cast the reference to an MCL contained inside the subVI

 

The first one would be my long term favourite, allowing me to bundle the utility into a polymorphic VI. The second option would be my other favourite, as I know the subVI will live inside a collection of exclusive MCL utilities.

 

Have I missed a trick? Is there a simpler, easier way of doing this?

---
CLA
0 Kudos
Message 1 of 5
(5,261 Views)
Solution
Accepted by topic author thoult

Actually you can create a polymorphic VI for each strict type you want.  See the Example code attached or snippets posted.

 

Code for Array Type:

Copy Items (Array).png

 

Code for Scalar Type:

Copy Item (Scalar).png

 

Main VI.  Notice middle is broken because of type mismatch.

Main.png

 

Hope this helps.  I can be paid in kudos and/or solutions.

Quentin "Q" Alldredge

Chief LabVIEW Architect, Testeract | Owner, Q Software Innovations, LLC (QSI)
Director, GCentral | Admin, LabVIEW Wiki | Creator, The QControl Toolkit
Certified LabVIEW Architect | LabVIEW Champion | NI Alliance Partner



Message 2 of 5
(5,219 Views)

See, I'm running 2013 SP1 here.

 

Any MCListbox (Strict) control references that I create, regardless of the control it's created from and that control's selection mode setting, will seemingly only provide access to a scalar Value property. Hence my confusion!

---
CLA
0 Kudos
Message 3 of 5
(5,200 Views)
Solution
Accepted by topic author thoult

@thoult wrote:

See, I'm running 2013 SP1 here.

 

Any MCListbox (Strict) control references that I create, regardless of the control it's created from and that control's selection mode setting, will seemingly only provide access to a scalar Value property. Hence my confusion!


D'oh!

 

Turns out I dropped in a strict reference for a MCL with the correct selection mode and then unticked the Include Data Type option in the RCM. Once you've done this, trying to revert back to a strict reference type loses the original selection mode setting - hence my problem.

---
CLA
0 Kudos
Message 4 of 5
(5,177 Views)
I'm glad you got it worked out and that I could help.
Quentin "Q" Alldredge

Chief LabVIEW Architect, Testeract | Owner, Q Software Innovations, LLC (QSI)
Director, GCentral | Admin, LabVIEW Wiki | Creator, The QControl Toolkit
Certified LabVIEW Architect | LabVIEW Champion | NI Alliance Partner



0 Kudos
Message 5 of 5
(5,167 Views)