# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Receiving analog signals for only 5 seconds and use the minimum maximum of them

Hi everyone.

Now I'm mearsuring analog signal from the strain sensor  using Arduino!
When I got the signal in real time, I found Min/Max Value and using values to mapping&scaling.
But sometimes, high value(noise) from unstable electrode. that caused the problem in mapping range.
So I just want to fix the Min/Max value without noise.

For example, I want to receive analog signals for only 5 seconds and use the minimum maximum of them. Not the min/max in real time.
How can i adjust the time or number of analog signal recived??
Using Another loop? or Is there the way to maintain the min/max value which set first 5 second?

Message 1 of 4
(804 Views)
Solution
Accepted by jdb8673

## Re: Receiving analog signals for only 5 seconds and use the minimum maximum of them

Hi jdb,

do you know the sample rate of your data?

Then just collect "sample rate * 5 seconds" of data in an array and get min/max of that array!

Otherwise use a (while) loop to read samples and stop the loop using ElapsedTime set to "5s" to collect your sample array…

(Nice to see you finally created your scaling function! :D)

Best regards,
GerdW

using LV2016/2019/2020 on Win8.1/10+cRIO
Message 2 of 4
(793 Views)

## Re: Receiving analog signals for only 5 seconds and use the minimum maximum of them

Put the elements in an array, put the array in a shift register. If the array gets bigger than the nr. of elements, use Delete Array Elements to get the most recent nr. of elements. That will give you a point-by-point history of nr. of elements.

There's actually a build in function "Array Max & Min PtByPt.vi" (use Quick drop) that does this.

Message 3 of 4
(788 Views)

## Re: Receiving analog signals for only 5 seconds and use the minimum maximum of them

Hi Wiebe,

wiebe@CARYA wrote:

That will give you a point-by-point history of nr. of elements.

This basically is the same as the PtByPt-DataQueue!?

Best regards,
GerdW

using LV2016/2019/2020 on Win8.1/10+cRIO
Message 4 of 4
(783 Views)