From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Nightmare...

I may have a new pumpkin icon..  🙂

 

I'm skill digging through the nightmarish code...  What a Rube Goldberg Maze!!

It's more frightning than Halloween with a power outage!

 

The guy who who wrote the code does not know anything about arrays nor types..

Lots of string controls being converted to numeric and then to booleans..

 

0 Kudos
Message 31 of 56
(8,620 Views)

Wake Up Ray!!!!!

Regards
Ray Farmer
0 Kudos
Message 32 of 56
(8,605 Views)

I should be able to wake up this weekend.. Or Monday at the latest.

 

Maybe I should go to bed, too...  😉

😄

0 Kudos
Message 33 of 56
(8,585 Views)

After spending that last two weeks on-site trying to get a new version of an old comercial app running with the new wistles and bells, I was tempted to send out a copy of "The Jabberwoky" as my trip report... but I have yet to slay the beast.

 

It was probably the cheshire cat popping in occationally and saying only "that is bad" then disapearing along with the white rabbit declaring I have no time but that is wrong!" that inspired that idea.

 

The app was started in LV2 by self taught developers. It has over a 1000 VIs each of which are monsterous with locals and globals galore and world record number of stacked and nested sequence structures. Complicating the game, the app is so complex that it can only be run as an executable with hardware!

 

It took me a week to rule out hardware failures and faluty triggering. Hours before I was scheduled to depart last Friday, I dug down through 7-8 levels of VI involving Call by Ref nodes to find out that I have two process attempting to read from the same I/O sub-system so of cousre they are stealing each others data... DOH!

 

The only postive I can admit is the customer is one of our LV students so he and I can lagh and giggle over the extent to which the LV style guide can be abused.

 

I will be jumping back into the rabbit hole again soon to see if i can fix the architectural problem (I really feel stupid that it took me a week to be able to understand the app well enough to ID the arcitectural issue.

 

If you don't hear back from me, suspect the walrus.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 34 of 56
(8,538 Views)
I am the walrus, goo goo g'joob goo goo g'joob.

Expert textpert choking smokers,
Don't you think the joker laughs at you?
See how they smile like pigs in a sty, -John Lennon
Putnam
Certified LabVIEW Developer

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


LabVIEW Champion



0 Kudos
Message 35 of 56
(8,533 Views)

I hope you won't be flying out in a Jefferson Airplane

 

We all feel for you Ben


"Should be" isn't "Is" -Jay
0 Kudos
Message 36 of 56
(8,513 Views)

Rube Nighmare or Spagetti?

 

It's a nightmare.

 

I can't post images for many resons (121M zipped for one reason) but maybe I can pile up enough words to make the Rube (If you did a video of what it takes to start this beast in exe highlighting, it would be a rube that went on for hours) I am returning too tomorw.

 

Code ws started in LV 2 to talk to a custum built widget. Over time it moved from serial to GPIB to ethernet and USB. So VI server call by refs used to select the right type of call (no big deal of course).

 

Had to talk to a DB somewhere back in history so DDE calls to peak and poke (which of course silently timeout when the traget is not running).

 

I suspect somehwere about LV 5 the multithreading entered the picture causing all types of issues with the plethora of locals and globals (code was writien by C coders) SO.. lets through in some semaphores to fix the globals. This one of the first apps I have touched that used ALL of the functions on the sycronization pallette and for good measure they threw in binary, datalog, config files and registry entries to makes sure they did not miss anything.

 

But paralel loops not working correctly so we'll add a bunch of notifiers and let them play ping pong to get the timing right. But then things got interesting! Interseting optimization pattern observed where the occurences were created in the center of the diagram to minimize the delay time passing to the varios loops. But they used other techniques to fix the race conditions like "Lets do the init 3 times to make sure it sticks".

 

A new version of the app was due to be deployed and to avoid issues with the house of cards on which is was originally developed, not changes were allowed to the underlying structure. So how to use without making changes to the previous? Easy! VI server property nodes let you reach out and punch buttons on any screen you want from anyhwhere you want. (Oh what a tngled web we weave when first we practice to deceive.).

 

But polling stop buttons and save buttons is bad code so lets add event structures in the new VI to trigger from the old ones and then we can punch locals (used instead of those confusing shift registers that are always three screesn away from where the wires are used). But then they find that the dynamically triggered event has to do some thing in the old codes so once again simple, use VI server to punch the button on the old VI when the dynamic event in the new fires. And when they found another situation to be hndled using the same technique yey another loop in another corner of the digram was added to handle that.

 

A particular challange was restarting since it still had to be triggered by the same button that was in the original house of cards so the unwinding of of all of the GUI screens was imlemented using a design pattern that amounted to fording a stream on stilts because they had to destroy what they were standing on after each step. Keep in mind we need to keep all of the displayed setting and mind their units less we miss Mars completely. 

 

Troubleshooting amounts to "This VI calls this brown VI with a command "7" and option "4" and parameter equal "37". Inside the brown the seven gets converted to a 9 if options are 1-3 and in that case we call a green VI with command 2...." After finding the VI called by the call by ref and looking into it I find a blue VI being passed a 12 and an array of u8s.

 

Naming was a special treat in itself. VIs were named as if they were developed for DOS (DSPIO for example). Of course they were not limited for control names so they have names like "Stop-Go", "Stop-Go2", and (you guessed it) "Stop-Go3".

 

Toss on top of that the app has to run in multiple languages, so every display item will have different names depending on which country and which option was selected.

 

So what didn't I find in the code?

 

Comments (in any langauge)

Action Engines

Type definitions (not even the enums)

 

Any sign of intelegent design.

 

WHat can I say good about it?

 

1) It works !

 

2) It is a wonderful trivia test for anyone learning LV. It uses everything (yes even a little LVOOP) and poses the question "Is there anything we missed?"

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 37 of 56
(8,483 Views)

Don't feel bad Ben.

 

I too have been digging the rabbit hole for a week.  It was time for me to come up for a breath of fresh air!~

 

I decided to delete the original text...

0 Kudos
Message 38 of 56
(8,467 Views)

Ben,

 

Interesting read.  I hope they are paying you at the Hazardous Duty Rate!

 

Once you get it fixed, it won't work anymore.  Maybe. Probably.

 

Lynn

0 Kudos
Message 39 of 56
(8,449 Views)

@Ben wrote:

Toss on top of that the app has to run in multiple languages, so every display item will have different names depending on which country and which option was selected.


Ben



Maybe just give them an English->Other languages guidebook (or a babelfish).

0 Kudos
Message 40 of 56
(8,405 Views)