LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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

Solved!
Go to solution

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?

 

123123123123.png

0 Kudos
Message 1 of 4
(800 Views)
Solution
Accepted by jdb8673

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 LV2020 on Win8.1+cRIO
Message 2 of 4
(789 Views)

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.

0 Kudos
Message 3 of 4
(784 Views)

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 LV2020 on Win8.1+cRIO
0 Kudos
Message 4 of 4
(779 Views)