LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a refnum for a specific type of control

Hi All,

I have attached a VI that I made, but not from scratch.  As near as I can tell, it is not possible to make this subVI from scratch because one cannot find a Dignum Refnum in any menu containing refnum's.  However, the edit>Create SubVI menu function was not only able to make a subVI for me, it was also able to magically create the refnum I needed in the first place (the one I needed to make the subVI from scratch). 

This is not a huge question, but the whole thing took me an extra, and annoying, 0.5 hrs this morning because I insisted that if LabVIEW can create that refnum, so can I.  I was wrong.  Or was I?  What am I missing here?


(The reason I had to specifically use the DigNum RefNum is because a simple control reference doesn't have access to the text properties).

Cheers,
Brad
0 Kudos
Message 1 of 9
(5,283 Views)

Hello

Hope this helps?

Andreas

There's three different kinds of people, those who can count, and those who can't.
0 Kudos
Message 2 of 9
(5,276 Views)
I'm stuck on LV 8.0, so I can't see what you've done.

I succeeded with the subVI that I posted, but I want to know how to create such a control reference from scratch in order to achieve access to the text colors property of a generic property node once it is attached to this type of refnum.

Brad
0 Kudos
Message 3 of 9
(5,262 Views)
Hi
I'm not at work right now so i can't convert my code for you. To create that CtlRefNum do the following:

1. Put a control ref. on the fron panel.
(right click on the ctlrefnum)
2. choose the class, gobject, control,numeric numeric.
3. choose type, digitaln it will now change its apperance.
4. choose to include data type, this is where you get that little orange star on the ctl.

I think this was the correct steps, but i'm not 100% sure.

Regards Andreas




There's three different kinds of people, those who can count, and those who can't.
Message 4 of 9
(5,252 Views)
I usually do it by creating a reference to the control I want, then right-clicking on the output of this reference and selecting create -> control. Voila, a refnum control that is the same type as the control. I just cut and paste this into the sub vi.
Message 5 of 9
(5,247 Views)
I used to use the sub-VI method to create the proper type of refum control.
 
I believe it was a past Nugget that showed me that if I did a "ctrl-drag" of a control ot the type I wanted onto a generic refnum control, the refnum would adapt.
 
 
First step
 
 
Ctrl-drag boolean onto refnum
 
 
drop and it adapts.
 
This feature was added in a recent version of LV. Not sure which.
 
Ben

Message Edited by Ben on 03-30-2007 02:56 PM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Download All
Message 6 of 9
(5,247 Views)
Thanks all.  That was very helpful.  Especially the nuggete - oh how we miss the nuggets...
0 Kudos
Message 7 of 9
(5,203 Views)

"oh how we miss the nuggets..."

I'm dancing as fast as I can! Smiley Surprised

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 9
(5,195 Views)

@Marc_A wrote:
 
I usually do it by creating a reference to the control I want, then right-clicking on the output of this reference and selecting create -> control. Voila, a refnum control that is the same type as the control. I just cut and paste this into the sub vi.

..and as a valuable bonus this method gives the refnum a name derived from the control's name. Like MyStartStop --> MyStartStop 2.

 

The other methods like the drag-drop gives it a generic name such Bool Refnum i.e. emphasis on the type rather than the control.

 

Would be nice if drag-drop into a Refnum worked in this sligthly more useful way. That it is a refnum is implicit in the appearence so this is not needed as part of the name. 

0 Kudos
Message 9 of 9
(3,246 Views)