LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

A Thing of Nightmares. Recommendations when reworking abhorrent code?

Solved!
Go to solution

It says the VI was last updated in 2017, so I assume some modification may have been made last year or is just an artifact of moving something slightly and saving all changes.

0 Kudos
Message 32 of 68
(2,519 Views)

It appears that it was never an official NI toolkit, and was designed for traditional DAQ. Noted by Bob and Analog in this post:

https://forums.ni.com/t5/LabVIEW/Lock-In-Amplifier-Start-Up-Kit-Removal-Clarification/td-p/3677844

Message 33 of 68
(2,513 Views)

So it wasn't deja vu I was experiencing today, thanks for finding that post from a year ago!

 EDIT: Or was that deja vi?

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 34 of 68
(2,503 Views)

My recommendation, back away slowly from your desk, click the red X in the upper-right corner and hope you are never forced to edit that thing.  If you do find a way through that, and like a challenge, I can send you some more VIs.  We need to petition NI to setup up a "Fix my code for a beer" feature in the forums.  Anyone care to write a feature request?

Message 35 of 68
(2,485 Views)

The style of code looks typical for the 90ies. And the PW protection, while it could have been used to protect the precious IP a PLL consists of Smiley Very Happy, more likely was in place to protect the innocent from exposure to bad code style.

Rolf Kalbermatter
My Blog
Message 36 of 68
(2,468 Views)

Oh wow.

 

For a lockin, that's some really messed up spaghetti nightmares there.  I mean, a major part of the code seems to be the LP filter (in a Rube Goldberg kind of fashion), there are certainly much easier ways to do that than what is on show here.  I think this started out as "just a little filtering" and grew exponentially (organically) into this - thing.

 

Document the behaviour, use it as a golden template for testing and re-write from scratch.

 

There's almost nothing to salvage here.

0 Kudos
Message 37 of 68
(2,450 Views)

I'll probably mess with the code sometime today.. Will most like not get as far as I'd like to with it either; however, I will keep everyone updated in this thread. On the other hand if anyone has some PLL code similar to this feel free to send it my way... 

 

Best Regards

0 Kudos
Message 38 of 68
(2,421 Views)

Did you try...

 

Help >>> Find Examples

 

Search tab

 

"Phase Locked Loop"

 

The modulation Toolkit has examples that may help you.

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 39 of 68
(2,415 Views)

I'll give a try here shortly, cheers!

0 Kudos
Message 40 of 68
(2,405 Views)