10-25-2010 03:29 PM
Just started a new job developing new systems and cleaning up existing systems.
Came across this beauty in their archives.
This is but a small snapshot of a much more horrifying display.
The basic premise is this: tester is running four test systems in parallel.
So the LV coder made individual case structures to contain every control on the front panel.
Then put them all in a for loop to update them all in sequence.
This same process was repeated throughout the entire VI. It is a marvel to behold!
Imagine the (wasted) time and dedication it took this person to create a case structure for every control on the front panel, and populate each one with a local variable!!
Boggles the mind.
10-25-2010 03:40 PM
Looks like the programmer came from a text-based programming background. Feel free to post this in the Local Variables thread or the Rube Goldberg thread. It's a candidate for either one.
10-25-2010 04:09 PM
But even from the old text-based background on initializing everything directly, the multiple case structures don't make sense. Even the text based code would look stupid:
for i=0 to 3 do
// Control1
case i
0: control1_1=0
1: control1_2=0
2: control1_3=0
3: control1_4=0
// don't forget to add another case if there is one more test station
end
case i
//ok, let's initialize the next control....
Felix