From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -20006 with curve fitting and simulated signal

Solved!
Go to solution

I have a mini-vi that i use to put data into a DAQ, which will be an E/P Converter. However, when i try to put the data into curve fitting so that i can configure a relay, i get error 20006, telling me that i need at least 2 samples. Since the generated sine wave has multiple signals, i thought it made sense for that to be enough, although this seems to not be the case, and i would appreciate if someone were to check the attached snippet and let me know what i can do to avoid this error

0 Kudos
Message 1 of 5
(3,032 Views)

Sigh. Don't have 2017 installed, so can't "peek inside" your Express VIs (don't get me started on these things ... -- the only thing I dislike more is their Evil Twin, the Dynamic Data Wire!).  So I'll only make some "observations" --

  • I couldn't find/figure out your second Express VI, but so what?
  • You split the Dynamic Wire into two parts, then immediately rejoin them.  Why?
  • Ordinary Fitting Functions (Linear Fit) take a 1D array of data and fit it.  I'm guessing (the Help isn't 100% clear) that the Express VI also wants to fit a single Signal, not two of them.
  • Because I can't "see" inside your Express VIs, it is unclear to me what Signals you are generating and what Function you are fitting.  What do you think the input signal should look like, and what are you trying to find by doing Curve Fitting (i.e. what is the Fitting Function)?
  • It would be so much easier for you (and for us) if you could wean yourself from using Express VIs and, instead, use the equivalent (non-Express) functions that come with LabVIEW.  You could then use 1D and 2D Arrays of Dbl, know what is being carried, see coercion dots and broken wires when you hook up the wrong thing, better understand the Error Messages when you "disobey the rules" on input and output assumptions, etc.  I do realize you are probably a beginner in learning to use LabVIEW, but consider taking this "next step" (ask your instructor for help, or ask here on the Forums).

Bob Schor

 

Message 2 of 5
(3,016 Views)
Solution
Accepted by topic author ShamtejRana711

@Bob_Schor wrote:

Sigh. Don't have 2017 installed, so can't "peek inside" your Express VIs (don't get me started on these things ... -- the only thing I dislike more is their Evil Twin, the Dynamic Data Wire!).  So I'll only make some "observations" --

  • I couldn't find/figure out your second Express VI, but so what?
  • You split the Dynamic Wire into two parts, then immediately rejoin them.  Why?
  • Ordinary Fitting Functions (Linear Fit) take a 1D array of data and fit it.  I'm guessing (the Help isn't 100% clear) that the Express VI also wants to fit a single Signal, not two of them.
  • Because I can't "see" inside your Express VIs, it is unclear to me what Signals you are generating and what Function you are fitting.  What do you think the input signal should look like, and what are you trying to find by doing Curve Fitting (i.e. what is the Fitting Function)?
  • It would be so much easier for you (and for us) if you could wean yourself from using Express VIs and, instead, use the equivalent (non-Express) functions that come with LabVIEW.  You could then use 1D and 2D Arrays of Dbl, know what is being carried, see coercion dots and broken wires when you hook up the wrong thing, better understand the Error Messages when you "disobey the rules" on input and output assumptions, etc.  I do realize you are probably a beginner in learning to use LabVIEW, but consider taking this "next step" (ask your instructor for help, or ask here on the Forums).

Bob Schor

 


1. the second vi is a relay that i renamed to show the positive values of the simulated signal, only.

2. Lab view decided that it was going to make that split and rejoin when i hooked it up.

3. I wish i understood any of that, i am very new to labview, and i dont exactly know how many signals im generating.

4. the curve fitting is to find the slope of  the generated signal, so that only when the values are positive are the data recorded. the input should be a sine wave, with only positive values that go up to 25.

5. I know none of the rules, and am actually trying to complete this project without any classes or really any guidance other than online and application help.

 

But thanks man, i think i may have figured out that taking the actual simulated signal out and putting it in a for loop with 2 iterations will gather the 2 required data points, and will use them to compute the slope using the point-slope formula in the express vi.

 

0 Kudos
Message 3 of 5
(2,988 Views)

@ShamtejRana711 wrote:

But thanks man, i think i may have figured out that taking the actual simulated signal out and putting it in a for loop with 2 iterations will gather the 2 required data points, and will use them to compute the slope using the point-slope formula in the express vi. 

I'm not sure (again) what you are doing, but if you have a waveform (and access to all of its points) and you want to know if the slope between point N and point N+1 is positive or negative, simply subtract, as Point[N+1] - Point[N] will be positive if the slope is positive, negative if the slope is negative, and 0 if the slope is zero.  If you really want the value of the slope, you need to divide by the difference between whatever N+1 and N represent (i.e. if they are time samples at 1 Hz, (N+1) - N = 1 sec, while if 1KHz, (N+1) - N = 0.001 sec).

 

Bob Schor

Message 4 of 5
(2,958 Views)
Solution
Accepted by topic author ShamtejRana711

i just took the DAQ i had and took it out of the while loop, put it in a  for loop with 2 iterations. Now, it takes the points it needs, and uses them in the actual program. the problem was that it couldn't calculate slope until there was 2 iterations of the signal, so i wasn't generating anything other than 1 point, and it is impossible to get the slope with only one point.

0 Kudos
Message 5 of 5
(2,827 Views)