LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Darren's Weekly Nugget 02/27/2006

This week's nugget deals with front panel control references. If you need a control reference on the panel (like when you're sending a control reference into a subVI), you typically drop a Control Reference from the Refnum palette on the front panel, right-click, and choose the appropriate class. Also you sometimes will have to right-click and choose "Include Data Type" when dealing with a control class that may have more than one data type associated with it (like a single-select vs. a multi-select listbox). This gets even more confusing if the data type of the control you're dealing with is not the "normal" data type of that control (an array data type listbox is a good example).

Turns out there's a much easier way to create a class-specific, type-specific control reference on the front panel. Assuming you already have the appropriate control (like our afore-mentioned listbox) on your front panel, just drop a control reference on the front panel, then control-drag the control *into* the control reference. You'll see that the control reference automatically adapts to be of the proper class and data type of the dragged control.

-D

P.S. - Check out past nuggets here.
Message 1 of 6
(9,876 Views)
Hey Darren, again excellent advice. I never imagined I could create the references that way. Thanks!



Robst - CLD

Using LabVIEW since version 7.0


0 Kudos
Message 2 of 6
(9,863 Views)
I used to create a reference from control, then right-click and create control, and then cut-paste to the SubVi front panel.

Your way is much faster, just drag created reference constant to SubVI's front panel!!

Thanks!
Aitortxo.
0 Kudos
Message 3 of 6
(9,855 Views)
Excellent nugget.  No more browsing for the exact control!Robot Happy
Ryan Vallieu CLA, CLED
Senior Systems Analyst II
NASA Ames Research Center
Message 4 of 6
(9,792 Views)
Sweeeeeet nugget



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 5 of 6
(9,747 Views)


@Aitortxo wrote:
I used to create a reference from control, then right-click and create control, and then cut-paste to the SubVi front panel.


I did it this way as well...  Now I have to write a vi to try this out!

Thanks Darren!

0 Kudos
Message 6 of 6
(9,502 Views)