LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

time derivative

Solved!
Go to solution

Hi! I've been struggling with a problem in Labview for some time.

I have a VI in which I acquire some analog signals (mainly temperatures) and I need the  temporal variation of these values

over a variable span of time (let's say, from 10 s to even 10 minutes).

I've been trying to create a VI to make a time derivative (not mathematically), simply calculating a difference in temperatures in two given points and dividing for the time difference.

Hpwever, I can't make it work!! I attached my VI, if someone knows how to fix it, would you kindly help me?

Thanks,

Valeria

0 Kudos
Message 1 of 7
(3,393 Views)

Valeria,

 

your buffer VI is nonsense. Please review the concept of Functional Global Variable in order to work on a flexible data container. If you like, you can add stuff there and make it an Action Engine which already provides the analysis.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 7
(3,366 Views)

Norbert, thank you for your answer. I looked at FGVs and I realise why they are useful to store data, but there's something I still don't understand:

if I need a buffer of 10 or 20 elements, how do I store all of the values?

0 Kudos
Message 3 of 7
(3,358 Views)

Your statement is that you want to take the difference of two (consecutive) temperatures and divide by Delta-t.  You can do this "on-the-fly" by using a "Do-once" While loop with a shift register to "remember" the previous temperature (which I call X).

dXdt.png

The current value, X, comes into this loop and comes out unchanged, but with a copy saved in the Shift Register (for the "next time").  You use the current value in the Shift Register (which is the previous value of X), take the difference and divide by Delta-t, giving you an estimate of dX/dt.  Do you see how that works?

 

One thing to realize is that the first time into this loop, there is no "previous" point, so the default value of 0 will be used, probably giving you a poor estimate for that first point.

 

You can use this as the points are being acquired, or you can acquire all of the points and then feed them through this one at a time using a For loop, all depending on your program's need.

 

Bob Schor

0 Kudos
Message 4 of 7
(3,352 Views)

no, the problem is that I don't have to do the difference of two consecutive numbers:

I acquire data on average each second but I want the difference of temperatures "distant" ten or 60 seconds.

0 Kudos
Message 5 of 7
(3,346 Views)
Solution
Accepted by topic author Turillo

Valeria,

 

you can implement a circular buffer in your FGV. In effect, you store an array and replace the element one by one storing the index of the last accessed item (additional shift register).

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 7
(3,328 Views)

ok, I think I've understand! Thank you

0 Kudos
Message 7 of 7
(3,325 Views)