08-27-2009 10:09 AM
I am receiving the following error message when using CurveFit.SplineInperpolant:
The type initializer for 'NationalInstruments.Analysis.Math.CurveFit' threw an exception.
An code example VB.Net using this command would solve my problem.
Thank You
Mark Hansen
08-28-2009 02:15 PM
Hi Mark,
According to the help for Measurement Studio in Visual Basic, the SplineInterpolant function takes 4 parameters - 2 Double arrays representing the X and Y data, a Double value representing the initial boundary and a Double value representing the final boundary. The help also has an example of using this function:
Dim xData() As Double = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0}
Dim yData() As Double = {1.0, 2.7, 7.4, 150.0, 80.0, 220.0}
Dim secondDerivatives() As Double
Dim initialBoundary, finalBoundary As Double
' Causes SplineInterpolant method to set the initial boundary condition for a natural spine
initialBoundary = 1.0E+30
' Causes SplineInterpolant method to set the final boundary condition for a natural spine
finalBoundary = 1.0E+30
' Calculate secondDerivatives
secondDerivatives = CurveFit.SplineInterpolant(xData, yData, initialBoundary, finalBoundary)
The Measurement Studio help can be accessed by using the Measurement Studio menu and selecting NI Measurement Studio Help. In the window that appears, I used the Search tab to search for "SplineInterpolant" and looked at the reference information for the CurveFit.SplineInterpolant method.
If, after looking at the example, you are still getting the error message, could you post a code snippet so we can see what you are doing?