ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

References in General?

Solved!
Go to solution

 

Hey there, Labview Gurus!

 

So, I’ve got this program that generates data and then graphs the curve of points with a Leven-Marq best fit lorentzian. I’ve got it working the way I want, but then I was told to use the Least Squares method instead (which involves using the constrained nonlinear curve fit VI).


Originally I was trying to avoid this, as it used references and the like for f(x,a), which I don’t know anything about. I was trying to find some sort of aid or tutorial, but everything is so complicated. Can someone simply point me in the right direction of a ‘how to’ or, give me a brief low down on what I’d like to accomplish?

This has been my issue really, finding that the simple stuff is what I don’t grasp.


A million thanks,

 

Vari

0 Kudos
Message 1 of 6
(4,061 Views)

In order to do this, you need to use the template that is referenced in the help file to create the fitting model. Save that VI, and wire that filepath into an Open VI Reference. Next, right click on the f(X,a) terminal of the Constrained Nonlinear Curve Fit VI and select Create >> Constant. Disconnect that constant from the curve fit VI, and connect it to the type specifier VI refnum terminal of the Open VI Reference. Then wire that to the reference terminal of the Constrained Nonlinear Curve Fit VI. When you are done, that part of the code should look like this;

 

varinem.png

 

Hope that helps!

John B.
Embedded Networks R&D
National Instruments
Certified LabVIEW Developer
0 Kudos
Message 2 of 6
(4,002 Views)
Solution
Accepted by topic author Varinem

I would advice agains using a vi reference via a constant filename, because it make keeping track of the model more difficult, especially when building a standalone application or moving the project around.

 

All you need is a strictly type VI reference, e.g. as follows:

 

  1. place a static VI reference on the diagram,
  2. right-click...browse for path...point to the model VI
  3. right-click the static reference and make it strict (red star)
  4. hook it up the the nonlinear fitting VI, ignore the coercion dot.

(See also)

 

Message 3 of 6
(3,999 Views)

That was the first code that I tried, but I just can't stand coercion dots. It's my own personal OCD tick. 😉

John B.
Embedded Networks R&D
National Instruments
Certified LabVIEW Developer
0 Kudos
Message 4 of 6
(3,978 Views)

I love coercion dots! :o:D (just kidding)

 

(I think this one is lossless and very benign ;))

Message 5 of 6
(3,976 Views)

Good info there. Thanks!

John B.
Embedded Networks R&D
National Instruments
Certified LabVIEW Developer
0 Kudos
Message 6 of 6
(3,954 Views)