LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

curve fit with daqmx

hello

im having a little problems using nonlinear curve fit

i am currently trying to fit a curve to

a0*(1-(a2/2)*atan((2*a3*a4)/(((1+2*a3)^2+a4^2)*(a5/(2*x))+1+2*a3+a4^2)))^2

the values that i deal with for a0 are supposed to come from the program but i haven't found yet the way to insert them on the diagram, the curve fit express doesn't have a input for external variables and im having problems with the other one

also, the most important problem i have is when im trying to fit a curve with data acquired with daqmx or with daq assistant
whenever i try to fit form a .dat file it runs with no problems but when the data comes from daqmx it just returns a flat line

i just cant figure why this happens

hope you can help me

thank you
Download All
0 Kudos
Message 1 of 2
(2,462 Views)

Hi,


You have two options: one (easier) is to right click the Curve Fitting express VI and select “open front panel”, there you will see and string constant that is passing with the equation change it to a control and wire it in the connector pane. Make sure you select: “operate->change to edit mode”. After you have done this you will have access to the string control and you will be able to make some small code that will parse the string with the coefficients that you need. See figure 1.



figure 1

Second options would be: instead of using the express VI looking for the low level replacement, but this is a little bit more difficult. See Figure 2.


figure 2

Now for you second question: I have a question who is returning a flat line the curve or the DAQmx assistant? What I would suggest is: 1-checking how many samples you are reading back from the card, 2- the extract portion of the signal has 0 and 1 limiters does that returns you 1 sample, 3- probe the input to the filter the output and the input to the curve fitting and check what values are actually been passed.

I hope it helps



Message Edited by Jaime F on 07-30-2008 03:39 PM
Jaime Hoffiz
National Instruments
Product Expert
Download All
0 Kudos
Message 2 of 2
(2,428 Views)