06-25-2009 02:11 PM
06-25-2009 02:16 PM
You didn't include the SubVi.
The Make Current Values Default shows you nothing when selected, but you can save it, and we will get all input data with it.
Also post the error that shows up, that is the most important info.
Felix
06-25-2009 02:25 PM
I couldnt' find the value saving part for the sub vi. I have attached the sub vi though. The error that I get is as follows:
Error - 20037 occurred at curve fitting -> Subvi -> Example.vi
Possible Reasons:
Analysis: the number of data points in the Y values array must be greater than the order
This doens't really make sense because the Y values are supplied to the function by the DAQ Assistant which should keep giving values until I stop the vi.
I will actually be leaving work shortly, so if I don't reply soon that is why. Thank you for your help, and I hope that you might be able to continue the help tomorrow.
06-25-2009 02:29 PM
Your input data is empty for now, as the error says. From the old post I see, that you plot before the trigger, maybe something's wrong with that. I'm of the forum soon as well.
Felix
06-25-2009 02:31 PM
clousekc wrote:
This doesn't really make sense because the Y values are supplied to the function by the DAQ Assistant which should keep giving values until I stop the vi.
No. Your DAQ assistant is set up to give 1 sample on demand. So only 1 sample is being passed through the trigger and gate Express VI and on to your subVI.
Try setting your DAQ assistant to give N samples on demand where your N is greater than 6.
06-26-2009 08:07 AM
06-26-2009 08:23 AM - edited 06-26-2009 08:25 AM
clousekc wrote:
I understand that it is saying the data is empty, but that could be due to the fact that it is stopping. It is not only taking one sample. It is set on continuous in my vi. I don't know if that changes when someone else opens the file. Basically if you simply just take the curve fitting vi out and wire everything back together, then the vi works. I just can't see why adding the curve fitting vi messes everything up. Unless I were to have it wired wrong. However, I played around and changed the fit to linear and it worked. However, the fit of course is completely wrong. Any thoughts?
Yes. Your DAQ assistant is only taking 1 sample. Open up the Example VI you posted in your first message. Open up that express VI and you will see. That 1 sample goes to the Trigger VI, then onto your subVI. Your subVI can't curve fit to a single point.
Don't be confused by the waveform chart. A waveform chart maintains a history of the data points it collected before as well as the new data point you are just adding.
06-26-2009 08:39 AM
As Ravens Fan said, the data at the first iteration of the loop is less than N (6). So the Curve Fitting VI throws an error and the loop stops. Please visualize the data that was aquired.
You could dismiss the error from the curve fitting vi and only use the daq error. Then your loop should run until you have enough values to perform the fit.
Felix
06-26-2009 08:57 AM
No matter how many times that loop runs, there will only be a single sample in that blue wire.
Now if the poster decides to read the waveform chart history after 6 or more iterations, or builds the data into an array and maintains it in a shift register (this would need a lot of datatype conversion to extract the real data out of the blue wire), only then will there be enough data to do the curve fitting.
06-26-2009 09:37 AM
Can you show me an example or something of how I could go about doing what you described Ravens Fan? I can't seem to figure out how you are just seeing the one sample going into the curve fitting. I'm not saying that's not what is happening. It's just my DAQ Assistant is set on continuous sampling, so the waveform graph aside shouldn't the sampling remain continuous? If I take out the express vi for curve fitting my lvm file has a lot more than just one data point. I guess what I'm saying is that when I put the curve fitting vi into my vi is when things go bad. Why would the express vi only take one data point when there should be many? Does the input for the curve fitting have to be an array then instead of just a straight 'data feed'? I apologize for my lack of knowledge, but again everything I do know about Labview is from playing around or reading help menus.