LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

calculate area plot

Solved!
Go to solution
Highlighted

 Hello.
Who knows how to calculate the area under a curve bounded by two cursors?
I bring my non-working option. I went through the entire “integral” palette and nothing helped. There is no calculation.

integral.png

0 Kudos
Message 1 of 8
(279 Views)
Highlighted

Hello!

 

Try to add an indicator (or probe) to the blue indices. You probably want to use the threshold 1d function: https://zone.ni.com/reference/en-XX/help/371361R-01/glang/threshold_1d_array/

 

Then, add indicators to the X and Y array that You feed into the integration VI. I guess that their size is different, because you limit the X array but not the Y array. This might or might not be an error, depending on what You want to do here.

0 Kudos
Message 2 of 8
(263 Views)
Highlighted

I need to calculate the area under the curve in the selected area.
Example in the picture.

ОС-1Е 273_(405+950нм).png

0 Kudos
Message 3 of 8
(228 Views)
Highlighted

Have You tried the things I have written above? What was the result?

 

Next time, please attach the .vi file.

0 Kudos
Message 4 of 8
(221 Views)
Highlighted

Yes. I did as you said. Nothing succeeded. I tried the whole palette of the integral and also nothing.

It does not count correctly or in any way at all.
I found an example of how to calculate the integral, and built it into my VI.
Now everything is correct. I attach my VI. Maybe it will help to someone .

МКС-1 113_(950нм)_20200529_141821.jpg

0 Kudos
Message 5 of 8
(206 Views)
Highlighted

Hi Fizi,

 


@Fizikaman wrote:

Yes. I did as you said. Nothing succeeded. I tried the whole palette of the integral and also nothing.

It does not count correctly or in any way at all.
I found an example of how to calculate the integral, and built it into my VI.
Now everything is correct. I attach my VI. Maybe it will help to someone .


What about this:

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2019 sometimes) on Win10+cRIO
Message 6 of 8
(170 Views)
Highlighted
Solution
Accepted by topic author Fizikaman

I usually use locked to plot cursors and then use the cursor index to get the correct subset. Here's a quick example:

 

altenbach_0-1590773890727.png

 

 

Personally, I would probably resample the input into a linear X axis with a reasonable sampling interval, then use the plain integration tools (not shown). Then you can just integrate the entire dataset and take the difference of the integral between two different indices to get the integral of the subset. (not shown)


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 7 of 8
(160 Views)
Highlighted

Thanks to everyone. I think this topic will help many people.

0 Kudos
Message 8 of 8
(107 Views)