07-28-2014 11:59 AM
Hi,
Description of intended function:
Given position as a function of time, I am attempting to calculate the powerspectrum of the object in motion, then "block" the data (smooth it by replacing n consecutive elements of data with the average of those n elements), lastly I need to apply a curve fit to the blocked power spectrum. However the code will not run, saying there is an internal problem to the curve fitting VI. speciffically, the error list says:
Poly VI 'NI_Gmath.llvlib:Nonlinear Curve Fit.VI': SubVI is not executable
Poly VI'NI_Gmath.lvlib:Nonlinear Curve Fit.vi': Polymorphic subVI is broken
Attached is the program, it can be run from the "main pannel.vi" file. The test.dat file is the data I've been using for testing
This is my first post to the NI forum, so I'll pre-emptively appologize if this is in the wrong place.
Thanks,
Sam
07-28-2014 01:13 PM - edited 07-28-2014 01:23 PM
Your VI is full of race conditions due to overuse of local varaibles. For example there is no guarantee that "df" gets a valid value in the FOR loop before the code above it writes to the "df" local variable. Eliminate all these locals and hidden controls and just use a plain wire. (same in the subVI).
I haven't look at your data yet.
You also need to retain useful default values, for example for the model description, before you attach a VI. These fields are currently blank.
Code looks quite convoluted in places.... Why don't you connect the erorr out to the fitting VI? The output size of the subVI might not be as expected since you do a division and rounding for the loop count.
07-28-2014 01:16 PM
Ok, thank you very much. I'll try fixing that.