LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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

It's called the Swap Values function.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 191 of 368
(2,065 Views)

@johnsold wrote:

Steve,

 

With a small effort you could qualify for the Obfuscated Code thread with that.

 

Someone was looking for a disappearing wire recently. A modification of Steve's idea allows this:

 

Buried wire.png 

 

...

 

Lynn


 

Sorry Steve but I have to side with Lynn on this one. Besides, the sub-VI

 

 

will return the string for the value of the enum used in the sub-VI and not the enum of the enum wired to the sub-VI. So that would be sub-VI that could only be used on one enum to work correctly while the explicit LV code (no sub-VI) would adapt to the enum wired.

 

Trust me, you are not alone and I have wlaked that same path.

 

Set broken record mode = true

 

Just because we could does not mean we should (Jeff Goldbloom character from Jurasic Park)

 

Set broken record mode = false

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 192 of 368
(2,060 Views)

If you think that's obfuscated you should see what it looks like without the little arrows

 

Example_VI_BD.png

 

I still don't like the idea of using combobox constants. If you want to use a dropdown string it is better to use an enum and convert it to a string. The format to value is kind of big compared to the constant but maybe I did go a little overboard minimizing the subVI. And while the subVI is only useful with one particular typedef enum, you could make a polymorphic VI with several of them. This is a lot of work to avoid taking up real estate with format to value.

 

Re: Invisible wires and things you can do in LabVIEW but that doesn't mean you should.

 

But the wire doesn't stretch very far!

 

I_BD.png

 

 

 

=====================
LabVIEW 2012


Message 193 of 368
(2,037 Views)

@crossrulz wrote:

It's called the Swap Values function.


Heh! I've never found that function before! Thanks for the link. 😄

/Y 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 194 of 368
(1,929 Views)

It can sometimes be difficult to connect wires into a VI with a 28 connector pane...

Even with less connector, it can be daunting at times. Here is an example of mine:

 

ScreenHunter_001.jpg

 

Luckily, you can right-click on the VI icon on the block diagram and unselect "View as Icon" to obtain:

 

ScreenHunter_002.jpg

 

Mo betta!

 

Well, that's not all! As for Express VIs (Express what?), you can pull down the little arrows at the bottom to reveal:

 

ScreenHunter_003.jpg

 

Tada!

Message 195 of 368
(1,854 Views)

It is like deja vu all over again:

 

http://forums.ni.com/t5/LabVIEW/Micro-Nuggets-Post-em-if-you-got-em/m-p/1825035#M625540

 

Somedays I am glad that I do not have the kind of problems that this is the answer for...  Smiley Very Happy

0 Kudos
Message 196 of 368
(1,853 Views)

More concise though... But I agree and never used this feature. As a matter of fact, I don't think it is very practical at all, and so you could argue that this is the sacarstic version of Steve's micronugget. In particular, the attentive eye will have noticed the truncated terminal names...

0 Kudos
Message 197 of 368
(1,847 Views)

Norbert demonstrated a neat trick for detecting double clicks on controls that I thought should be included here. It uses the mouse up event on a disabled but not greyed out button.

=====================
LabVIEW 2012


Message 198 of 368
(1,785 Views)

Just a Bump for them Micro-Nuggets, keep 'em comming. Even the simplest of Nuggets are great.

ItTakesaVillage.PNG

Richard






0 Kudos
Message 199 of 368
(1,676 Views)

Did you know...

 

Wiring 0 to the Timeout of a DAQmx Read results in LabVIEW's attempt to read data ONCE? This can be a useful troubleshooting or benchmarking tool to ensure (for example) your producer is synched up to your comsumer.

 

Read Once or throw error.PNG

Richard






Message 200 of 368
(1,660 Views)