02-05-2008 07:22 PM - edited 02-05-2008 07:24 PM
Just saw (and fixing(?) ) code recently which is not as big as tst's example, maybe half the size... Full of stacked sequence structures...
--- sigh --- but that's not so bad...
--- sigh --- 😞
it is FULL of Local variables. Each and every value on practically every wire is connected to a Local Variable. Either read or write.
Also saw something that intregued me and I was impressed for a moment until I realized what it meant..
A cluster whose input cluster is a local... I'll show an example (not from the code)... needless to say my arms dropped when I realized what it meant. All clusters are in this fashion.
My example is not quite right... you'd have to replace the indicator with a Local Variable. All terminals (ctrl or indicator) are located in one frame not connected to anything.
It's the second time I encouter such style.. The authors are from different cities... Many miles apart.. Same style.. interesting... 😮
02-06-2008 07:33 AM
Hi Ray,
I would guess the author of that code does not know about typedefs so using that code constructs allow them to change the cluster def without breaking the code. Let me go onto guess that app does not have many or any sub-VI's.
RE: tst "Scary"
We have taken over a number applications that were orignally developed by other LV shops. One of them has been in developemnt for about 11 years and looks very similar. We have been cleaning the code up one VI at a time. The funny part about code like that is that as I wonder around the cubicle farm and peak at the code others are developing, the first thing of their mouth is;
"I did NOT write this!"
Ben
02-06-2008 10:18 AM
Ben,
I wish you were right! 😮
There are 205 sub-vi's all abusing Local Variables extensively..
I'd get in trouble if I showed you the code.. But imagine sub-vi's having 5 layers of Stacked Sequence Structures.. Every layer passing data via Locals.
Average number of Locals PER terminal is 25.
(is it ok to cry?)
02-07-2008 07:01 AM
JoeLV,
It might look bad for someone with solid colors to cry. I found some of CC's friends to do the job for you.
02-07-2008 10:48 AM
02-08-2008 12:16 PM - edited 02-08-2008 12:19 PM
02-08-2008 02:47 PM
JoeLabView wrote:
My example is not quite right... you'd have to replace the indicator with a Local Variable. All terminals (ctrl or indicator) are located in one frame not connected to anything.
It's the second time I encouter such style.. The authors are from different cities... Many miles apart.. Same style.. interesting... :o
My confession: i began programming Lv exactly this way: all varialbes in the first frame of a sequence. in the following sequences, used only locals.
I think this programming way is very similar to the more classical test based programation: one defines variables, then calls them in the different "pages" of the prog. this might also be a reason why LV has such stacked sequences to begin with. It probably also took time for the NI engineers to develop different programming techniques suited for the graphical language.
02-14-2008 06:14 PM - edited 02-14-2008 06:15 PM
02-21-2008 12:03 PM - edited 02-21-2008 12:05 PM
02-21-2008 12:12 PM