07-11-2012 08:06 AM
It's called the Swap Values function.
07-11-2012 08:13 AM
@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:
![]()
...
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
07-11-2012 09:04 AM - edited 07-11-2012 09:11 AM
If you think that's obfuscated you should see what it looks like without the little arrows
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!
07-21-2012 02:39 PM
@crossrulz wrote:
It's called the Swap Values function.
Heh! I've never found that function before! Thanks for the link. 😄
/Y
07-25-2012 05:16 PM
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:
Luckily, you can right-click on the VI icon on the block diagram and unselect "View as Icon" to obtain:
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:
Tada!
07-25-2012 05:32 PM
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...
07-25-2012 05:38 PM - edited 07-25-2012 05:39 PM
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...
07-27-2012 01:55 PM
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.
08-17-2012 09:59 AM
Just a Bump for them Micro-Nuggets, keep 'em comming. Even the simplest of Nuggets are great.
08-17-2012 10:32 AM - edited 08-17-2012 10:33 AM
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.