10-12-2010 09:26 AM
Continued from here ... Post whatever you learned today, or any morsel of LabVIEW knowledge no matter how small. It's all good!
10-12-2010 11:59 AM
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 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.
10-13-2010 03:11 PM
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.
10-13-2010 04:56 PM
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.
10-14-2010 06:57 AM
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.
10-14-2010 07:01 AM
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.
10-14-2010 08:02 AM - edited 10-14-2010 08:06 AM
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.
10-14-2010 01:50 PM
Today I stumbled of this behaviour of the Threshold function using tuples (points).
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.
Felix
10-15-2010 02:45 AM
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.
Greetings,
shb
10-15-2010 08:09 AM
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.
Ben