LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mini-Nugget Create cluster def using bundle middle input

Solved!
Go to solution
I stumbled across a tip by Greg McKaskle this week-end that may help you out.
 
I often have to define cluster type def's for use by sub-VI's. On large clusters, the defining can be combursome because LV wants to add a number to controls I control copy. If i am smart, I'll control-copy the controls from the original on my GUI, and drop directly into the cluster contaner. Since it is inside the cluster, LV does not change the name.
 
But when I want to use control refs, lief gets more complicated. Fo control refs (like when I want to manipulate a GUI from a sbu-VI) I can pop-up on the control terminal (on BD) and select "Create ref". The names of the refs match the original control. so far so good.
 
But then I need real controls that I can drop in the cluster container. I had previously right-clicked on the ref and selected "Create Control" to get the correct ref type. Problem is the new control ref has the number "2" appended to the name. Previously I would go through all of the labels and edit out the "2". WELL not ANYMORE!
 
If I drop a "bundle" (NOT a BUNDLE-BY_NAME) on the diagram and just wire all of my control refs to it.
THEN
Right-click on the middle terminal and select "Create Control".
 
The result is a control on the of the proper type ready to be saved as a type def!
 
I hope someone finds this Nugget helpful.
 
Ben
 
Past Nuggets can be found here
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 1 of 16
(17,391 Views)
I'm sorry, Ben. I must still be asleep this Monday morning because I read this three times, and I don't quite see the process, or when one would use this. Can you provide a more concrete example?
0 Kudos
Message 2 of 16
(17,371 Views)
Solution
Accepted by Ben
 
 
 
 

here are some visual aides to go with the previous idea.

These are controls refs I want to pass to a sub-VI

I wire them to a bundle

After creating the control, my cluster names tach the controls I will wire. No need to edit the names and get rid of the " 2" LV automatically adds.

Ben



Message Edited by Ben on 01-21-2008 10:33 AM

Message Edited by Ben on 01-21-2008 10:34 AM

Message Edited by Ben on 01-21-2008 10:34 AM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 16
(17,364 Views)
Ah, I see now. I currently don't need to do anything like that in any of the projects I've done, but you never know what may turn up in the future...

0 Kudos
Message 4 of 16
(17,347 Views)
Very cool, Ben. Two tips in one. I didn't know you could create a control in this manner. And the auto-control-number-increment (or whatevertheycallit) is something I don't NEED sometimes, and a real annoyance. This will be quite handy in the future.
PaulG.

LabVIEW versions 5.0 - 2020

“All programmers are optimists”
― Frederick P. Brooks Jr.
Message 5 of 16
(17,343 Views)
Here's an alternative approach for creating control refs that most people don't seem to know about. It's not really better than Ben's new approach, but it's worth knowing.

You can create a reference control typed to a specific control by dropping a generic Control Refnum control from the Refnum palette onto the front panel and then drag the desired control into the refnum. That will change the type of the refnum to that specific control type and mark it as Strictly Typed if necessary (if it's not a standard type such as Boolean).

This process doesn't automatically set the label for the control refnum, so Ben's still out of luck here. But it's an easy way to create control refnums of the proper type.
Jarrod S.
National Instruments
Message 6 of 16
(17,320 Views)
Ben,

One extra feature of the type defs might be worth to mention.

If you customize the icon, you'll also see the icons in your block diagram
(not only the hierarchy window), in stead of the standard control icon. That
only works if you display the terminals as icon though.

If you have several type deffed controls, this could save a lot of time,
because you can distinguish between them just by looking at them.

Regards,

Wiebe.


Message 7 of 16
(17,263 Views)
Ben,
Thanks for the Mini-Nugget I will keep learning untill I Know ALL of LabVIEW.



CLAD



Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 8 of 16
(17,158 Views)

" I will keep learning untill I Know ALL of LabVIEW."

"From your mouth to God's ears!" ohiofudu!

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 16
(17,150 Views)
Thanks also to Jarrod for his comment. I knew there had to be a better way than my old clunky method.
0 Kudos
Message 10 of 16
(16,929 Views)