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: 

discovering a cluster/multicolumn control from its reference

Solved!
Go to solution

Pierre_F_1-1684662290149.png --------> Pierre_F_2-1684662320396.png

 

hello! do you know if there is an efficient way to know the control type referenced by a refnum, regarding clusters/arrays/multicolumn lists?

the option "show control" often just returns an empty control, wherehas a typed control is truly pointed.

you can reproduce the example by selecting your control and right click "create->reference" then right click at the reference and "create->control". In my project I have lots of these kinds of refnums, apparently void, and I don't have access to the initial control made for their creation.

 

any help is welcome 🙂

Pierre FCentum TNS, Grenoble
Certified LabVIEW Associated Developer
0 Kudos
Message 1 of 6
(687 Views)

Depending on the particulars, this might be helpful:

  1. Wire the reference to a property node.
  2. Select the "Value" property.
  3. Right-click on the "Value" terminal and select "Create Control".
0 Kudos
Message 2 of 6
(629 Views)

If you have a strictly-typed Control refnum, you can know its contained type by using the "Get Refnum Information.vi" from the Data Type Parsing Palette:

raphschru_0-1684742893943.png

 

0 Kudos
Message 3 of 6
(613 Views)

thanks 🙂

Pierre FCentum TNS, Grenoble
Certified LabVIEW Associated Developer
0 Kudos
Message 4 of 6
(592 Views)

Pierre_F_0-1685022474545.png

Hello, I'm still blocked regarding multicolumn listboxes (see code joined - lv2020). the previous suggestions don't work

 

"

Depending on the particulars, this might be helpful:

  1. Wire the reference to a property node.
  2. Select the "Value" property.
  3. Right-click on the "Value" terminal and select "Create Control".

This way just returns an enum

 

"If you have a strictly-typed Control refnum, you can know its contained type by using the "Get Refnum Information.vi" from the Data Type Parsing Palette:"

 

IWith this way I don't get relevant information to understand what is different about this reference

 

can you help?

Pierre FCentum TNS, Grenoble
Certified LabVIEW Associated Developer
0 Kudos
Message 5 of 6
(519 Views)
Solution
Accepted by topic author Pierre_F

The type included in a strictly-typed MultiColumn ListBox refnum (i.e. the type of the "Value" property) is either an I32 or an array of I32 representing the index(es) of the currently selected item(s). Whether it is a scalar or an array depends on the right-click menu configuration of the MultiColumn ListBox: "Selection Mode" -> "Data Type" -> "Scalar" or "Array".

 

Scalar Mode:

raphschru_0-1685024345666.png

Array Mode:

raphschru_1-1685024426587.png

 

 

To be able to wire together strictly-typed refnums, the included type must be the same.

 

In your example, your control refnum is a strictly-typed Scalar MultiColumn ListBox refnum, while the type contained in the cluster is a strictly-typed Array Multicolumn ListBox refnum.

 

 

2 options:

 

1. Make the refnum in the cluster NOT include the type (Right-click on the refnum, uncheck "Include Data Type").This will add a coercion dot and your refnum will be converted to a generic (non-strict) refnum:

 

raphschru_5-1685025228667.png

 

 

2. Change the Selection Mode of your Multicolumn ListBox to "Array" to make it compatible with the strict type in the cluster:

 

raphschru_4-1685025190234.png

 

 

0 Kudos
Message 6 of 6
(510 Views)