LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Have local variables outlived their usefulness??

Hi,
Just wanted to find out if there are any uses of local variables that can't be achieved with property nodes of a control or indicator.
Or should NI scrap them...Smiley Happy Any Ideas???





Labview 8 video tutorials available at www.fafiles.com
National Instruments LabVIEW beginner video tutorials available at www.fafiles.com. Get Wired Up!!!
0 Kudos
Message 1 of 10
(3,541 Views)
They should not be scrapped. See this thread. If you are using the value property node instead of a local variable, your program is taking a big performance hit. You had better update your tutorials.Smiley Wink

Message Edited by Dennis Knutson on 02-22-2006 02:56 PM

Message 2 of 10
(3,527 Views)

As I'm sure has been pointed out countless times on these forums, the performance of a local variable is orders of magnitude better than using the Value property of a control or indicator.

-D

Message 3 of 10
(3,523 Views)
Not to mention that it also takes two steps to get to the Value property whereas with a local variable it's just one. Just had a nitpicking moment. Back to normal now.
0 Kudos
Message 4 of 10
(3,474 Views)
In my (extremely humble) opinion, local variables are the GOTO of LabView.  Useful under specific conditions, but often misapplied by novice programers.  In addition, I do not think that NI should ever abandon any feature.  There are enough compatability issues between revisions without completely removing features.
Message 5 of 10
(3,460 Views)
Local variables certainly have their use, but they are also easily abused.
 
Long ago, I wrote some thoughts:
 
 
 
Don't forget that we have now a third option in LabVIEW 8.0, the Shared Variable. It comes much closer to a viable local variable replacement and has a few very nice features. 🙂
0 Kudos
Message 6 of 10
(3,434 Views)
Rather than start a new thread about this, perhaps my question is topical here:

Can you send different values from different frames of a Flat Sequence to a single indicator without using local variables, or do you have to use a Stacked Sequence instead?
0 Kudos
Message 7 of 10
(3,409 Views)

How do you propose doing it any different way using a Stacked Sequence Structure?  If you want to write a value to an indicator, and you don't want to wire to its terminal, you must use a local variable or the Value property.

-D

0 Kudos
Message 8 of 10
(3,406 Views)
Oh, that's right, sequence locals don't do that...

Well, I guess local variables are still useful that way. 🙂
0 Kudos
Message 9 of 10
(3,396 Views)
And the best way is to not use either a flat or stacked sequence structure and wire directly to the indicator. If you replace the sequence structure with a state machine, you'll be much better off. Here's a simple one. LabVIEW ships with other examples.
Message 10 of 10
(3,393 Views)