LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two nonlinear fitting's function in one

We bought the LabView 6.1 and I have no clue
how to make the Lev-Mar work (and many other
functions as well).

There are some tasks in the 'getting start' manual
that tells you step-by-step of doing things.
I appreciate any body can tell me how to 'write'
a Lev-Mar from clicking the first buttom step-by-step.

Anyway, before that, I copied an Lev-Mar example
for my simple task. It works OK. But when I use
two in the same vi, it seems when I change one
function/derivative, it change the other one too.

My question two: How to make 2 or more different
function/derivatives in the same vi?

Thanks.
0 Kudos
Message 1 of 5
(3,077 Views)
The Lev-Marr VIs are tough to use. I recommend, as you did, looking at the shipping examples. Be sure to read the directions because one version needs to be opened and edited to fit the funcitons of your choosing.

LabVIEW conserves memory by reusing subVIs in memory. Sometimes this is not appropriate so you can set the VI as reenterant in VI properties. I do not this this is appropriate in your case. I recommend instead renaming one of the examples. This way you can make changes to one without affecting the other. If you think about it, it makes sence to use two different VIs if you want their functions to differ.
0 Kudos
Message 2 of 5
(3,077 Views)
Hi, Jeremy:

Attached is a made-off example of the problem.
Two set of time-amplitude data are from hardware.
They have to be fitted with differene function.
These two Lev-Mar must be inside one same vi as the
parameters are needed for following processing.

These two Lev-Mar's function/derivatives are
obviously different and must be present in this same
vi file. By clicking on Lev-Mar's Hierarchy >> Diagram
we can see the function nodes for function & Deveritives.

How to 'save' these two different function & Deveritives?

By the way, how to replace the MatLab box into
function node in my attached example?
(It's easy to cange MatLab output variable's type,
but I couldn't change the output variable's type.)
0 Kudos
Message 3 of 5
(3,077 Views)
The matlab question is easy. You will need to drop a new formual node (functions >> structures) and copy the equation into the new structure. Then you will need to configure the node by right clicking on the border and adding input and output variables.


I am not sure if you understand the complexities of the Non linear Lev-Mar VI. The problem is that you supply data to the VI and a funtion to fit. This function is not exposed in the top level VI and is located deep inside of the subVIs. To find the funtion node, follow this list:
Nonlinear Lev-Mar Fit >> Lev-Mar ABX >> Target Fnc & Deriv NonLin.vi

Because you cannot programatically edit the formula node, there was no way to expose the formula in the top level VI. You will need
to open your VI >> file >> save as and give a different name. Do this from the top level VI down to Target Fnc & Deriv NonLin.vi.
0 Kudos
Message 4 of 5
(3,077 Views)
Hi, Jeremy:

1) I can put a function-node there as you said.
But the doesn't allow me to "wire" the output to
the next dut to 'variable type difference'. You
can test it by replacing the matlab box into a
function node. I guess it needs another step of
outer-box or conversion which I don't know how.

2) As of the Lev-Mar, you mean it needs two series
of vi files for the two Lev-Mar? Could you please
make one based on my example and attached here?

Thank you very much.

Jian
0 Kudos
Message 5 of 5
(3,077 Views)