Showing results for 
Search instead for 
Did you mean: 

Micro-Nuggets !!! ~~~~ Post 'em if you got 'em

Continued from here  ... Post whatever you learned today, or any morsel of LabVIEW knowledge no matter how small. It's all good! 





Message 1 of 361

Here's something I just found out the hard way: The panel background images supplied with NI will make your EXE size shoot way up. A recent "weather widget" I made went from 83KB to 329KB Smiley Surprised just from using the supplied "Clouds" background. So, I captured a small section of the background image (no larger than my panel size) and saved it. Using that new background, I'm down to a reasonable 98K.


Message 2 of 361

Parsing information out of web pages is fun and easy. Check out the attached "Weather Widget" which you can dock on your desktop (make an EXE first).


When you first run it, click the check mark. It is set to Chicago. Go to the website shown in the string constant (you'll find it) and find your city. For some cities, you'll need to parse differently.






Message 3 of 361

When wanting to use a user made Run button, we all set the VI to run when opened, then usually wait in a while loop, polling the run button.  Darrin gave this tip about using an event structure without a while loop.  The event structure will wait for an event before exiting the structure.  No while loop needed, no polling needed.  Found here.

- tbob

Inventor of the WORM Global
Message 4 of 361

When using sub-panels, if you do not want the scrollbars to appear, you need to remove them from the vi that appears in the sub-panel.

In LabVIEW 2009, the way to remove the scrollbars is to right-click on the scrollbar and select Horizontal and choose Always OFF.  Repeat the same for Vertical Scrollbar.

Message 5 of 361

If you are developing code that will soon be built as an executable, but wish to exclude part of the code while you are developing it, you can use a Conditional Disable Structure and Edit Condition for This Subdiagram.  Select RUN_TIME_ENGINE == True and that portion of code will only be executed as part of you build, and not during development.

Message 6 of 361

Thanks Ray, I never thought of doing that with the Conditional Disable.


Another method is to use a Property Node:


Class = VI Server > Application

Property = Application > Kind


With this node, you can also set conditions for things like Student Edition, Evaluation version, and more. 


Message 7 of 361

Today I stumbled of this behaviour of the Threshold function using tuples (points).

Threashold VI with array of points.png

I still need to let this settle to capture it in words, because I wanted the threshold (index) of the first element in the cluster.



Message 8 of 361

Did you ever want to read or write a file encoded in UTF-8? There is no need for any operating system calls. There is a built-in function for converting to text and vice versa. They are not in a palette, but they are appended to this post.


Would you like them to be in the palette? Then vote for the idea. (I try to write a plug-in which does this, but I always get an error.)


Warning: As long as the text is proper UTF-8 and the characters exist in the current font page everything works. But when it is not the behavior is OS dependent (at least for LabVIEW 8.6 and 2009):

Windows XP: Non convertible characters are skipped. When the last character is invalid an error is returned.

Windows Vista + 7: Non convertible characters are replaced with a normal question mark. "?"

When you want to know it the conversion succeeded check if there are characters >=128 before AND after the conversion.




Message 9 of 361

Those are some nice tags you have added!


Thank you for the effort. I had told myself I should go through and tag all of these micro-Nuggets (which I should still do since it will help withe searches and statistics) but you have beat me to it.



Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 361