NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Trusted Enthusiast
for(imstuck)
Posts: 2,105

Make Smaller Icons

[ Edited ]

Little something I learned today that is pretty common knowledge I'm assuming, but I didn't know about it and have been working with LabVIEW for a couple of years now. Therefore, I assumed some others wouldn't know about it either. While there are wiki's out there that explain this, I know I usually come to these forums before googling so I thought I'd put something here.

 

In a recent project had a very simple action engine that appends update strings in multiple different threads, based on what has happened within the program, and displays them to a user in another thread that is there specifically for front panel updates. However, this action engine was way too clunky and took up too much space on my block diagram for something only having two input terminals, and 1 output terminal. Doing the following cleaned stuff up incredibly, especially in case structures where the only reason they were taking up extra bd space was because of this action engine...

 

 First, show your connector panes and make sure your have the bold area around the terminals you want to use. Then make sure you have each of the icons circled in red looking the same (you can do this by selecting one then copying it and pasting it into the other two boxes)

 

 

after that, voila, add it to your bd.

 

If anyone else has any other tip/tricks for icon editing feel free to add them.

 

 

Message Edited by for(imstuck) on 02-12-2010 01:44 PM


Greg Freeman - CLA, LV Version 2012, 2011, and 2010

G Systems, LP


Knight of NI
Knight of NI
Ben
Posts: 16,091

Re: Make Smaller Icons

Nice!

 

But....

 

You stoped one step short or nirvana. :smileysurprised:

 

*Create a warpper for each of the two actions (include the enum in the wrapper) and edit those icons similarly. Using a warpper for each action gives you

 

1)the ability to mark the input terminal on the "write" wrapper as required while also

2) loosing the  enum on top. This also,

3)  minimizes you (well maybe not you but me anyway) forgetting to set the right action.

 

Ben

 

* Idea of wrapper for each action was given to me by Jim Kring. It is a gift I use regularly.

Ben Rayner
Who is NOT John Galt... yet... just building Rayner's Ridge

Knight of NI
Dennis_Knutson
Posts: 29,330

Re: Make Smaller Icons

Making smaller icons is described in the LabVIEW help (icons>custom-shaped) and there is an example called Custom Shaped Icon (strangely enough).
Proven Zealot
Jeff·Þ·Bohrer
Posts: 5,429

Re: Make Smaller Icons

Within the last week I've actually posted TWO examples where I use small icons for sub-vis

CCI Time to Excel 

 Time to xl.png

and Magicically dragable Coersion Dot

Magic dot.png

 

For Style though- "A meaningful Icon should be created for all subvi's"  the real estate on the BD is useful for aiding the user and the developer trying to debug.  Be careful with WHEN you chose to reduce your ICON size lest you obfuscate the code (Hmmm LV Proverb?)

"Keep Thine Icon size maxim unless less is more"

8-Ball Consulting advertising banner

Certified LabVIEW Consultant. Behind the 8-Ball? Put the 8-Ball behind YOU!
Knight of NI
RavensFan
Posts: 13,413

Re: Make Smaller Icons

[ Edited ]

This was a good topic to mention.  It is one of those things that people might not think of.

 

One tip (and I think you basically said this, but not so clearly) is to make sure the X of the connectors you want to use are within the boundary of the icon you are creating.  In your case where you use one of the top connectors, the X is slightly below your rectangle, thus you see a bit of the wire passing through your icon and hitting the X that is now below your visible icon.  To correct this, you may want to pick a different connector pattern such as the 4-1-0-4 rotated 90 degrees.

 

 

It has 4 connectors across the top that have small enough squares so that all their X connection points would fall within your icon.

Message Edited by Ravens Fan on 02-12-2010 03:52 PM
Trusted Enthusiast
for(imstuck)
Posts: 2,105

Re: Make Smaller Icons


Ravens Fan wrote:

This was a good topic to mention.  It is one of those things that people might not think of.

 

One tip (and I think you basically said this, but not so clearly) is to make sure the X of the connectors you want to use are within the boundary of the icon you are creating.  In your case where you use one of the top connectors, the X is slightly below your rectangle, thus you see a bit of the wire passing through your icon and hitting the X that is now below your visible icon.  To correct this, you may want to pick a different connector pattern such as the 4-1-0-4 rotated 90 degrees.

 

 

It has 4 connectors across the top that have small enough squares so that all their X connection points would fall within your icon.

Message Edited by Ravens Fan on 02-12-2010 03:52 PM

Agreed. I should have mentioned this as random whitespace can look a little funny :smileysad:. Also, to comment on your first sentence. That is why I posted it, because often there are things that might seem common, but people don't know about/ think to look into further. LabVIEW is a big package and finding all the little things that may help can often be overwhelming. That kind of goes along with the post from Dennis. Yes, there is something about it in the LabVIEW help. But as we have seen on these forums, often people don't bother to look :smileyhappy: (as I didn't bother to for a while). Therefore, I hope this post can just make people aware that this is an option thats available. Maybe next time they will think, hey I could use that idea I saw on NI's forums.



Greg Freeman - CLA, LV Version 2012, 2011, and 2010

G Systems, LP


Member
Yuri33
Posts: 65

Re: Make Smaller Icons


Ben wrote:

Nice!

 

But....

 

You stoped one step short or nirvana. :smileysurprised:

 

*Create a warpper for each of the two actions (include the enum in the wrapper) and edit those icons similarly. Using a warpper for each action gives you

 

1)the ability to mark the input terminal on the "write" wrapper as required while also

2) loosing the  enum on top. This also,

3)  minimizes you (well maybe not you but me anyway) forgetting to set the right action.

 

Ben

 

* Idea of wrapper for each action was given to me by Jim Kring. It is a gift I use regularly.


 

I've been doing this for years, and there's even one more step to nirvana:

 

Create a polymorphic of all the wrappers.  That way you simply lay down the poly and it will automatically adapt to get/set functionality based on how you wire it.

 

For more complex AEs (with multiple actions), I still like to create a polymorphic of the wrappers, but I additionally choose to show the polymorphic instance label.  Now you have a single, easily usable interface to your AE.  All I do is plop down the poly, and select the instance I want on the block diagram.  With the label, anyone reading the code can easily understand what's going on.

Active Participant
craigc
Posts: 363

Re: Make Smaller Icons

The small Icon idea also works wonderfully for large Cluster constants.  Simply put the cluster constant on the BD and add an indicator.  Create a small icon and now you have a Small but usefull cluster constant when Bundling data together :smileyhappy:

 

Craig

LabVIEW 2009 .

DTA
Active Participant
Hooovahh
Posts: 265
0 Kudos

Re: Make Smaller Icons


Jeff Bohrer wrote:

Within the last week I've actually posted TWO examples where I use small icons for sub-vis

CCI Time to Excel 

 Time to xl.png

and Magicically dragable Coersion Dot

Magic dot.png

 

For Style though- "A meaningful Icon should be created for all subvi's"  the real estate on the BD is useful for aiding the user and the developer trying to debug.  Be careful with WHEN you chose to reduce your ICON size lest you obfuscate the code (Hmmm LV Proverb?)

"Keep Thine Icon size maxim unless less is more"


Oh that reminds me of some odd code.  I once saw a sub VI that had one input one output, and the icon looked like an array of string wire.  So when you wired it up to an array of string in, and array of string out, it looked like there was no sub VI at all.  The code was not written by me, or anyone I know, but secretly manipulating data makes debugging software very difficult.  In your case I'm okay with it because you can see data changing, but my example is just another reason why code review is not a valid method of unit testing.  

Trusted Enthusiast
for(imstuck)
Posts: 2,105
0 Kudos

Re: Make Smaller Icons

[ Edited ]

Hooovahh wrote:

Oh that reminds me of some odd code.  I once saw a sub VI that had one input one output, and the icon looked like an array of string wire.  So when you wired it up to an array of string in, and array of string out, it looked like there was no sub VI at all.  The code was not written by me, or anyone I know, but secretly manipulating data makes debugging software very difficult.  In your case I'm okay with it because you can see data changing, but my example is just another reason why code review is not a valid method of unit testing.  



People will always find a way to abuse the system :smileysad:. As with all things, common sense should be applied. In my opinion, that developer used none. I am actually in favor of only using the standard sized icons for the most part. However, if I have some sort of error handler that only takes an error input to publish or something, I will make a small rectangle icon with only error in and error out so my queue ref wires don't have to navigate it etc. The more you develop, the more you learn to organize your VIs on the block diagram in a way that you can avoid bent wires even when using the standard icon size. But for certain cases, it is certainly nice to be able to reduce the size.



Greg Freeman - CLA, LV Version 2012, 2011, and 2010

G Systems, LP


By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page