LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Implementation of linear fit between two cursors

Solved!
Go to solution

Hi,

I am trying to implement a linear fit between two cursors, as I am using total of 4 cursors. I would like to implement linear fit between cursor 2&3. Please help me how to implement it and to find a slope. I am also attaching my code.

With Regards
Phani kiran
0 Kudos
Message 1 of 19
(4,293 Views)

Hello phanikiran,

 

It's just building an array of the two elements and simply connect them.

CURSOR.png

 

Hope this will help you!

 

 

Though I have some questions about your code, why are you using a while loop which you end in 1 iteration?

The rest of the code is just floating around and above the while loop.

Try to make it more rectangular shaped so you can see how the dataflow is intended.

 

Koen

---

UnCertified LabVIEW Student
Mistakes are for learning, that's why suggestions are always welcome!
Message 2 of 19
(4,284 Views)

hey thank you very much, its working for me. Yeah I will just check my code once regarding the while loop. 

With Regards
Phani kiran
0 Kudos
Message 3 of 19
(4,275 Views)

Let me help you a bit.

cursor.PNG

The two property nodes you use for the slope are excessive you can simply use the ones you already use for SiO2 indicator

---

UnCertified LabVIEW Student
Mistakes are for learning, that's why suggestions are always welcome!
0 Kudos
Message 4 of 19
(4,269 Views)

Hi Koen,

 

Thanks a lot, I have done the same thing.

 

Once again Thank you.

With Regards
Phani kiran
0 Kudos
Message 5 of 19
(4,256 Views)

Phani,

 

Did you already succeeded with deleting the while loop?

If you need any help with that or something else don't hesitate to ask.

Koen

---

UnCertified LabVIEW Student
Mistakes are for learning, that's why suggestions are always welcome!
0 Kudos
Message 6 of 19
(4,250 Views)

Hi Koen,

 

Yes I can run. If I have some questions definitely I will contact you.

 

With Regards
Phani kiran
0 Kudos
Message 7 of 19
(4,248 Views)

Hi koen,

 

Now I would like to merge both graphs i.e., Bestfit and XY Graph (in the block diagram). Can you suggest me, I have tried with build array and concenate Inputs function, but no use. Dont mine as I  am new to Labview. Thanks in advance.

With Regards
Phani kiran
0 Kudos
Message 8 of 19
(4,233 Views)

@phanikiran wrote:

Hi koen,

 

Now I would like to merge both graphs i.e., Bestfit and XY Graph (in the block diagram). Can you suggest me, I have tried with build array and concenate Inputs function, but no use. Dont mine as I  am new to Labview. Thanks in advance.


First, get rid of the Express XYGraph subVIs and use the "real" XY graph VIs. The Express ones get you going faster for simple things, but your options are limited.

 

Take your X and Y arrays for both your original points and the best fit points (just two points, right?) and combine them into clusters of arrays (instead of feeding them into the XY graph). Then combine these into an array and feed it into your graph. It's all outlined in the XY Graph section of the LabVIEW help file.

 

original.png

 

 

 

The LV Help File is your friend, learn to use it. It gets lonely if you don't look in on it once in a while.

 

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 9 of 19
(4,220 Views)
Solution
Accepted by topic author phanikiran

Hi Phani,

 

Saw you contacted me so here is the solution.

Actually Cameron already mentioned the solution above.

Anyway this it what it should look like when you implement it:

phani.PNG

Note: The while loop is just a pretention the output aren't in correct order.

 

Koen

---

UnCertified LabVIEW Student
Mistakes are for learning, that's why suggestions are always welcome!
Message 10 of 19
(4,180 Views)