LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Spline Interpolation

Hello..everybody.
I use to spline interpolation as in example directory. I have a problem that when I load the X,Y Data(interpolant) which size of each 1-D Array more than 200, and when I run program both with DAQ or Artificial array,it will have the error code "-2002 " -->The input sequences must be the same size.

I try to correct many thing but I have no solution now.

Thank you very much for any help.
0 Kudos
Message 1 of 6
(4,128 Views)
Do you have duplicate x-values?

Try to hook up an idicator to the currently unwired error_out terminal for the "spline interpolant vi" (located right before the spline interpolation.vi.)

You'll get an error -20049 if there are duplicate x-values, which later magically propagate to an error -2002 in the spline interpolation. Error -2002 is somehow misleading, because it is NOT the first error in the chain.

Correctly programmed, the spline interpolation should be bypassed if the earlier interpolant returns an error.
Message 2 of 6
(4,128 Views)
Thanks.. Altenbach.

U r absolutely right. it has an error -20049. But I don't understand the problem of duplicate x-value. because that I did is I load the x and y value from the textfile.txt and keep in Global variable. then, I send the x-array and y-array into the Spline interpolant.vi.

This is the same way, that I did with another textfile (which is only 200 dim) and it work. but why this file (1000 dim) is not working.

Thank you very much for ur kind help.

Nopporn
0 Kudos
Message 3 of 6
(4,128 Views)
HI... everybody,,,

I'd like to answer my question. Can u believe that I play around this problem for 2 weeks. Then I design to use Matlab code in which it works.

And at the end I realize that all of the problem only because of the data file that I load (I use German window which in Germany use (,) instead of (.)) used comma instead of point. e.g. 25.25 -->25,25

So... I just change , to . and everything works fine.
with spline function in Matlab and spline in Labview itself.

Thanks for anyhelp.
0 Kudos
Message 4 of 6
(4,128 Views)
> So... I just change , to . and everything works fine.
> with spline function in Matlab and spline in Labview itself.
>

Sorry it took so long to find the answer. For future reference, the
Tools Options dialog has an option to use the localized decimal in the
Front Panel page. This should make the default match the locale of your OS.

This always gets more compolicated though since some engineering tools
-- like instruments always use period, and never comma. For this
reason, all of the format's in LV should support the %.; and %,; options
tha you can place at the front of a string format to select what a given
string operation uses. If using the Format String, the dialog will help
you build it, but it should work for
other formats too.

Greg McKaskle
0 Kudos
Message 5 of 6
(4,128 Views)
Thanks for ur good solution for my OS.., Greg McKaskle
0 Kudos
Message 6 of 6
(4,128 Views)