LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
chris.b

View Cluster Constant as Icon

Status: Completed
Available in NI LabVIEW 2010

Clusters are powerful and necessary, but they can easily clutter up otherwise immaculate code.  Why not have a "View As Icon" option (a la Express VIs) for cluster constants?

 

3.png

 

Right-click menu change...

 

2.png

 

 

There have been similar suggestions, but I think we need a clean, simple solution.

Chris Bolin
LabVIEW Partner Program, CLA
47 Comments
RDR
NI Employee (retired)
Great idea!
Neil.Pate
Active Participant

Use a subVI?

 

That is what I always do. If you had to revert from the icon back to the cluster it would probably mess up the block diagram big time.

GregSands
Active Participant
I think I prefer Lavezza's suggestion here, which is essentially to provide an option for a Typedef'd control to show as an icon on the BD - unlike nrp's suggestion above, this means you only have to define a control, not a sub-vi as well.  Double-clicking opens the typedef as you would expect.
JackDunaway
Trusted Enthusiast

YES!!!, but instead, hopefully use the user-created icon of the typedef. That way we could have meaningful graphics on the BD. Refer to my idea about Eliminating the Typedef Explosion. It has some good conversation, and the consensus of the contributors is that having an icon for the typedef is good. Look at my summary (the sixth post) of tst's and Lavezza's ideas.

 

 

 

Message Edited by JackDunaway (mechelecengr) on 10-27-2009 06:13 PM
JackDunaway
Trusted Enthusiast
Greg, you beat me by 2 minutes! I'm just your Yes Man. And nrp -- that's the solution that many of us use, but I think it's a "hack" to need both a ctl file and a vi that has nothing but one output type of that ctl file.
chris.b
NI Employee (retired)

Good discussions!

Jack:  I like your Idea as well.  I do, however, think that Lavezza's suggestion and my "Idea" are more feasible and fit the LabVIEW paradigm more closely.

nrp:   I definitely use the subVI "hack" as well, but it's not idea for a number of reasons (unnecessary work, subVI overhead, and possible changes to inplaceness).

Chris Bolin
LabVIEW Partner Program, CLA
tst
Knight of NI Knight of NI
Knight of NI

It should be pointed out that this does *kind of* exist today.

 

If you use a control instead of a constant you get an icon in the BD. The obvious problem is that you now have a huge cluster on your FP (even if you make it invisible). Solution - the Control class in LV 2009 has a private method called Convert to Stub which converts the FP cluster into an icon. The result is that you have an icon in the FP and an icon in the BD. Not ideal, but better than having a huge cluster on your FP.

 

I haven't used this method, so I don't know how stable it is or how well it works, but it certainly seems like a step NI has taken in the direction of the idea suggested here.

 

Also, this is the third time in as many days that I'm linking to this, so I'm starting to feel a bit like a sales person, but I should point out that this could be used to cut the time needed for creating the subVI. We could have a modified version which, when invoked on a typedef, would create a stub VI for that typedef and give it the icon of the typedef, thus reducing the subVI generation to a couple of clicks.


___________________
Try to take over the world!
chris.b
NI Employee (retired)
tst:  Good points!  As for as the "Convert to Stub" control, there is still more overhead for a control than a constant, and it eliminates any constant folding benefits.
Chris Bolin
LabVIEW Partner Program, CLA
chris.b
NI Employee (retired)

And if the cluster is a type def, you would see its icon when using "View As Icon"...

 

4.png

 

Thanks Lavezza!

Chris Bolin
LabVIEW Partner Program, CLA
Broken_Arrow
Active Participant

Great idea.

 

chris.b Said:

> And if the cluster is a type def, you would see its icon when using "View As Icon"...

 

Also great! Except I would prefer that the icon not look too much like a VI. Also see this

Richard