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.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

List of potentially non-converging Analysis functions

Hello, hello,

I have a problem where a complex piece of code sometimes hangs. It does a lot of curve fitting, FFT, etc, using many functions from the advanced analysis library. I know that some of those functions can potentially get stuck in an infinite loop if the wrong data is input. Is there a list of those functions so I can filter and concentrate my debugging ?

Thanks

0 Kudos
Message 1 of 3
(978 Views)

I am not familiar with Labwindows/CVI (more of a LabVIEW programmer), but your question is not specific you any programming language. FFT is safe. How can you tell the difference between "stuck" and "just solving a complicated problem that naturally takes a very long time".

 

Any procedure that is iterative and has termination criteria (such as curve fitting) can take long if the termination is never met. Similarly if you have a division by zero when defining the iteration count of a FOR loop, you'll get a nearly infinite number of iterations. Also look at termination conditions that are based on equal comparisons of floating point numbers. Can't you add some debugging hooks to pinpoint where it gets stuck?

 

The analysis library is very robust, but can run into problems when fed with very unreasonable inputs. Can you be a bit more specific what your code actually does? How big are the data structures?

0 Kudos
Message 2 of 3
(952 Views)

Thanks for the answer. Yeah, there are a lot of FFTs and various curve fittings (one of my suspicion) on arrays of a few tens of thousands of samples.The size of the samples was recently increased twentyfold and we never had issues before, so I'm also checking the mallocs.

 

There's also a part of the code that seems translated straight from Fortran, with heaps of gotos, so it's difficult to tell whether it ever ends !!!

 

I'm adding printfs to try and pinpoint the problem.

 

Good idea on the float comparisons, I know my (old) part uses FP_Compare. I'll check the rest.

0 Kudos
Message 3 of 3
(937 Views)