LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an easier way to make an integrator for a real-time signal?

Solved!
Go to solution

I'm making a VI to calculate lung tidal volume, which is the integral of the difference between two flow sensors over time. I expected to find a function that would integrate some real-time signal coming in one data point at a time (using some internal state to remember the value it had) but so far haven't found anything like that. I wrote the below VI to do this manually using shift registers and a simple trapezoidal integration of the new signal based on the known rate of the loop.

 

This solution seems to work but I feel it's maybe over complicated, and it seems like there probably exists a pre-made function that uses the system time and an internal state to do this all without so many moving parts,and probably more accurately. I haven't been able to find anything so far by searching for it, but I am pretty new to Labview and might just be misreading or misusing some function.

 

Any help finding a better function, or any ideas on potential problems with this solution, would be appreciated.

0 Kudos
Message 1 of 6
(1,636 Views)

Hi Tarnarmour,

 


@Tarnarmour wrote:

I wrote the below VI to do this manually using shift registers and a simple trapezoidal integration of the new signal based on the known rate of the loop.

This solution seems to work but I feel it's maybe over complicated,


To me this VI looks like being simplified too much because it's empty…

Mind to attach your real VI?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(1,578 Views)
Solution
Accepted by topic author Tarnarmour

@Tarnarmour wrote:

I'm making a VI to calculate lung tidal volume, which is the integral of the difference between two flow sensors over time. I expected to find a function that would integrate some real-time signal coming in one data point at a time (using some internal state to remember the value it had) but so far haven't found anything like that. I wrote the below VI to do this manually using shift registers and a simple trapezoidal integration of the new signal based on the known rate of the loop.


NI_PtbyPt.lvlib:Integral x(t) PtByPt.vi

 

From the code inside, I think it might use trapezoidal integration.

 

 

Message 3 of 6
(1,570 Views)

Well I'm not sure how that happened, I'll be trying to check this one more carefully after I post.

0 Kudos
Message 4 of 6
(1,553 Views)
Solution
Accepted by topic author Tarnarmour

I can't open your VI because I haven't (yet) installed LabVIEW 2020.  But note Wiebe's reply -- the Point-by-Point functions can be found on the Signal Processing Palette.

 

Bob Schor

0 Kudos
Message 5 of 6
(1,533 Views)

Thanks! I've been looking at it and I think it'll massively clean up a pretty horribly messy VI 🙂

0 Kudos
Message 6 of 6
(1,496 Views)