NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Knight of NI
Ray.R
Posts: 10,167

Re: Why some people say Local Variables are bad...

Have a look at this example and read on to Gerd's reply where he found race conditions.

http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=344148#M344148

.
(starting to) See Life in a brand new way...

b* ^ )
Knight of NI
Ray.R
Posts: 10,167

Re: Why some people say Local Variables are bad...

Writing to the indicator and it's Local variable at the same time..

I guess it is to make sure that the value was actually written to it :smileywink: 

from: http://forums.ni.com/ni/board/message?board.id=170&thread.id=345782

.
(starting to) See Life in a brand new way...

b* ^ )
Knight of NI
Ray.R
Posts: 10,167

Re: Why some people say Local Variables are bad...

From: http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=357718#M357718

 

 

 

.
(starting to) See Life in a brand new way...

b* ^ )
Knight of NI
Knight of NI
Ben
Posts: 16,091

Re: Why some people say Local Variables are bad...

Hi Ray,

 

That Vi had my head spinning because its almost readable. So silly me I wander away and run right into this!

 

 

 

I did not spot any locals but I thought it should be offered as contrast to what you found.

 

Ben

Ben Rayner
Who is NOT John Galt... yet... just building Rayner's Ridge

Knight of NI
Ray.R
Posts: 10,167

Re: Why some people say Local Variables are bad...

You missed the locals on the right hand side of the image you posted:  Error & Mono Position & Mono Position (nm)

 

I'm sure if you keep looking you'll find more Locals..  :smileywink:

.
(starting to) See Life in a brand new way...

b* ^ )
Knight of NI
altenbach
Posts: 22,873

Re: Why some people say Local Variables are bad...

[ Edited ]

LOL Ray. One common theme in "chronic localitis" such as this is always a neat row of disconnected terminals. :smileyvery-happy:

 

Message Edited by altenbach on 09-29-2008 09:20 AM

LabVIEW Champion . Oh, by the way, I work for peanutsKudos .

Knight of NI
Ray.R
Posts: 10,167

Re: Why some people say Local Variables are bad...

Yes, I often see that.  This one is not so bad... It is when you have several frames of a Stacked Sequence that it get a bit annoying.  Now why do people not bring a wire directly to a terminal??  Oh yeah... they want to update its value are many different location in the software..  yeah....  hummm...  using Locals...  hummm..
.
(starting to) See Life in a brand new way...

b* ^ )
Active Participant
yenknip
Posts: 492

Re: Why some people say Local Variables are bad...

[ Edited ]

Someone has asked me to do a 'simple tweak' on this monstrosity, written by my predecessor.

 

The white area is 1280*1024 pixels.

 

 

Message Edited by yenknip on 10-07-2008 01:16 PM
_____________________________
- Cheers, Ed

Knight of NI
Posts: 18,064
0 Kudos

Re: Why some people say Local Variables are bad...


yenknip wrote:

Someone has asked me to do a 'simple tweak' on this monstrosity, written by my predecessor.

 

The white area is 1280*1024 pixels.


Where are the local variables? Where's my microscope that I had when I was 10?

 

Hmmmm... Maybe it's a good thing that you can't see the local variables!  :smileyvery-happy:

Active Participant
yenknip
Posts: 492

Re: Why some people say Local Variables are bad...

[ Edited ]

I just did a search for all instances of a variable, it came up with 537 occurrence :smileysurprised:

 

 


Message Edited by yenknip on 10-07-2008 04:26 PM
_____________________________
- Cheers, Ed

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page