From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Rate of Change measurement/calculation

Hi
I have been trying to design a loop so that I can read an input voltage,
then after
a period, (1 second) read the value again, and then calculate the change
in values.
I have been unable to get a difference value because the values are always
the last value read
so I thought I would ask if anybody has performed a similar task, and they

could give me a few pointers in the best way to do this.

I am using Labview 5.1 and feildpoint modules, and the task I am trying to
perform is measure the rate of pressure change
on a pressure transducer via an FP-AI 110 module.

Thanks

Allan
0 Kudos
Message 1 of 6
(4,143 Views)
Allan,

If you are unfamiliar with shift registers it might be of help to know that
the shift register located on the left side of the loop can be resized (pull
down on the corner or right click on it) so not only will you have the n-1
value but n-2, n-3 and so on. For more info, right click on the loop, click
online help and read about shift registers.

Jared

"Allan Parry" wrote:
>>Hi>I have been trying to design a loop so that I can read an input voltage,>then
after >a period, (1 second) read the value again, and then calculate the
change>in values.>I have been unable to get a difference value because the
values are always>the last value read>so I thought I would ask if anybody
has performed a similar task, and they>>could give me a
few pointers in the
best way to do this.>>I am using Labview 5.1 and feildpoint modules, and
the task I am trying to>perform is measure the rate of pressure change>on
a pressure transducer via an FP-AI 110 module.>>Thanks>>Allan
0 Kudos
Message 2 of 6
(4,143 Views)
Use a shift register in the loop to buffer the last datapoint between
iterations. So when you read the value, you wire it to the right hand shift
register, then the next time the loop iterates the same number is present at
the left one, to be subtracted from your new reading.

Allan Parry wrote in message
news:3a017388@newsgroups.ni.com...
>
> Hi
> I have been trying to design a loop so that I can read an input voltage,
> then after
> a period, (1 second) read the value again, and then calculate the change
> in values.
> I have been unable to get a difference value because the values are always
> the last value read
> so I thought I would ask if anybody has performed a similar task, and they
0 Kudos
Message 3 of 6
(4,143 Views)
Hi Allan:

There is a way of doing this without shift registers. Put your Acquire node inside a FOR loop. Set the iterations to 2. Then at the output of the for loop, you will have an array of two elements. Use two INDEX array nodes, assign the index of 0 to one, and the second to 1. The output of each index goes to the input of a SUBTRACT node..and voila! I use this for measuring doppler shift with an ionospheric radar.

Good Luck!
Eric P. Nichols
P.O. Box 56235
North Pole, AK 99705
0 Kudos
Message 4 of 6
(4,143 Views)

I am trying to measure continous temp measurements from a thermocouple and I need to designate a steady state point.  I have done the two index arrays and subtracted them but I need a way to separate the two values by at least a couple seconds.  I need the change of temp to be less than .2 degrees in a time span of around ten seconds in order to be steady state.  Any ideas of how I can do this?

 

Daniel

0 Kudos
Message 5 of 6
(3,549 Views)

Daniel,

 

Tagging onto the end of a 10-year old thread may not be the best way to get an answer.

 

It appears that you have your data in an array.  The most recent data is probably the last element in the array. To find the temperature from 10 seconds earlier, you calculate the index of that data from the reciprocal of the sampling rate.  For example suppose that you are sampling at fs = 20 Hz (Samples per second). Then the time increment, dt, between samples is dt = 1/fs = 50 ms. Then the sample 10 seconds earlier has an index difference of 10 s/50 ms = 200.  If the last element in the array has index (last) = 499, then the index (-10 s) = 499 - 200 = 299.

 

If your array is T, then the temperature difference at two times 10 seconds apart is T[last] - T[last-200].

 

If the temperature is fluctuating or there is noise on the measurement, you might be better off averaging several samples and looking at the differences of the averages.

 

Lynn

0 Kudos
Message 6 of 6
(3,535 Views)