NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Active Participant
Broken_Arrow
Posts: 1,846

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! 

 

 

MicroNug.png

Richard





Active Participant
Broken_Arrow
Posts: 1,846

Background Images can mean a Large EXE

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 :smileysurprised: 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.

Richard





Active Participant
Broken_Arrow
Posts: 1,846

Weather Widget - parse the web Micro-Nugget

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.

 

 

ww.png

 

Richard





Trusted Enthusiast
tbob
Posts: 4,089

Re: Weather Widget - parse the web Micro-Nugget

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
Knight of NI
Ray.R
Posts: 10,575

Removing Scrollbars in sub-panels

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.

______________________________________________________________________
Kudos!!!! Gimme Kudos!!!! It's that little golden star on the left below my avatar... :smileyhappy:
Knight of NI
Ray.R
Posts: 10,575

Select code to run only as executable

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.

______________________________________________________________________
Kudos!!!! Gimme Kudos!!!! It's that little golden star on the left below my avatar... :smileyhappy:
Active Participant
Broken_Arrow
Posts: 1,846

Select code to run only as executable Part 2

[ Edited ]

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. 

Richard





Active Participant
F._Schubert
Posts: 1,534

Re: Select code to run only as executable Part 2

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.

 

Felix

www.aescusoft.de
My latest community nugget on producer/consumer design
My current blog: A journey through uml
Active Participant shb
Active Participant
shb
Posts: 301

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

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

Knight of NI
Knight of NI
Ben
Posts: 16,135
0 Kudos

[OT] Tagging Micro-Nuggets

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

Ben Rayner
Who is NOT John Galt... yet... just building Rayner's Ridge
Scheduled to close on the new ridge next week!