BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Why some people say Local Variables are bad...

Passing that much data via a local that many times is more than a little bit.

0 Kudos
Message 321 of 396
(8,007 Views)

Not as bad as some, but adding to the fun.  They also use the property nodes instead of locals.

http://forums.ni.com/t5/LabVIEW/My-graphical-display-of-converted-hexadecimal-numbers-changes/m-p/21...



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 322 of 396
(7,943 Views)

EEK!

 

Seen here

 

 

 

Message 323 of 396
(7,874 Views)

After spending a number of months getting his project to work, my colleague has asked me to make a small hardware change.

 

localitis.png

 

VI size: 3.2MB

396 local variables

57 stacked sequence structures

A single test run will normally take upto a week of continual running, and the log file loop is timed with the 'wait until next multiple' function

 

Top right structure:

Sequence inside case inside sequence inside while inside case inside while

A whole bunch of control polling loops, yet has demonstrated understanding of the event structure

 

I'm rather tempted to do the quick change and put it into the code repository under someone else's name

_____________________________
- Cheers, Ed
Message 324 of 396
(7,816 Views)

@yenknip wrote:

After spending a number of months getting his project to work, my colleague has asked me to make a small hardware change.

 


Well, I think I found one disadvatage of being able to make parallel loops so easily in this language...

0 Kudos
Message 325 of 396
(7,787 Views)

@for(imstuck) wrote:

@yenknip wrote:

After spending a number of months getting his project to work, my colleague has asked me to make a small hardware change.

 


Well, I think I found one disadvatage of being able to make parallel loops so easily in this language...



LV 5.1 was a funny (I am being polite with that word) version of LV. It featured multipthreding but did not offer property nodes but instead used attribute nodes. Any non-trivial GUI required an "upside down" implementation wherein all of the low-level stuff had to be handled in the top level VI and the high level stuff was pushed down into the sub-VI. I suspect most of the "Scary" VIs that NI shows off in their seminars were actually developed in version prior to LV 6i or by a developer that stopped trying to "learn new tricks" in LV 5.1 or earlier.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 326 of 396
(7,784 Views)

@Ben wrote:

@for(imstuck) wrote:

@yenknip wrote:

After spending a number of months getting his project to work, my colleague has asked me to make a small hardware change.

 


Well, I think I found one disadvatage of being able to make parallel loops so easily in this language...



LV 5.1 was a funny (I am being polite with that word) version of LV. It featured multipthreding but did not offer property nodes but instead used attribute nodes. Any non-trivial GUI required an "upside down" implementation wherein all of the low-level stuff had to be handled in the top level VI and the high level stuff was pushed down into the sub-VI. I suspect most of the "Scary" VIs that NI shows off in their seminars were actually developed in version prior to LV 6i or by a developer that stopped trying to "learn new tricks" in LV 5.1 or earlier.

 

Ben


You just had to go and remind me about this, didn't you? I thought it was long forgotten and I was safe now.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 327 of 396
(7,770 Views)

@Ben wrote:

@for(imstuck) wrote:

@yenknip wrote:

After spending a number of months getting his project to work, my colleague has asked me to make a small hardware change.

 


Well, I think I found one disadvatage of being able to make parallel loops so easily in this language...



LV 5.1 was a funny (I am being polite with that word) version of LV. It featured multipthreding but did not offer property nodes but instead used attribute nodes. Any non-trivial GUI required an "upside down" implementation wherein all of the low-level stuff had to be handled in the top level VI and the high level stuff was pushed down into the sub-VI. I suspect most of the "Scary" VIs that NI shows off in their seminars were actually developed in version prior to LV 6i or by a developer that stopped trying to "learn new tricks" in LV 5.1 or earlier.

 

Ben


Sorry, I don't think I was even alive when LabVIEW 5.1 was out Smiley Tongue

 

But, in all seriousness, that picture of a diagram with crazy wires that NI always shows as an example of piss-poor code gets really old. I don't even laugh at it anymore. I think it must be part of their powerpoint template now, as frequently as I see it...

Message 328 of 396
(7,730 Views)

@for(imstuck) wrote:
...Sorry, I don't think I was even alive when LabVIEW 5.1 was out Smiley Tongue

 

But, in all seriousness, that picture of a diagram with crazy wires that NI always shows as an example of piss-poor code gets really old. I don't even laugh at it anymore. I think it must be part of their powerpoint template now, as frequently as I see it...


I never got a really good look at it but it looks strangely familiar to an app I was involved back in the 5.1 days.

 

Imagine you need to present a GUI that looked and felt like it used tab controls but you were not allowed to use tab controls (becuase they did not exist yet) and you were forced not to use control references but only property nodes on the diagram of the GUI (again since property nodes did not exist, they were attribute nodes).

 

You would need a plethera of visables disables etc.

 

Add to that all updates of controls would be limited to terminals and locals and for good measure there was no Event structure so polling was the game used to check for user actions.

 

 

AND ... (yes there is an AND)

 

LV 5.1 was the first version of multithreaded LV so prior to 5.1 the possiblities of Race Conditions were much less. It has ben removed from the standard option settings of LV (it can still be invoked with the right ini token) but LV had an option to allow you to run your code single threaded if you wanted. In many cases, they HAD to run single threaded.

 

Even a trivial app of that type could quickly turn into what those "ugly" diagrams looked like.

 

So cut the old guys code some slack! WE were developing with stone knives and bear skins back then.

 

Ben 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 329 of 396
(7,698 Views)

And the single thread that it would run in would be the already overworked UI thread, mostly running on the same hardware/processor as everything else. I had a GUI that had "tabs", liked to show it at the NI LabVIEW dog & pony shows. Really painful to implement (compared to today), but as Ben points out, so was much of the GUI stuff back then. Polling all of your controls to detect which one had been selected, ouch! Sort of made complex front panels really glacially slow to respond.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



Message 330 of 396
(7,693 Views)