LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding the maximum value from measurement

Solved!
Go to solution

Hello,

 

I have 4 pressure sensors that are hooked up to an NI USB 6000 for data logging. By exerting different level of pressure, I can collect analog input over time and show the results in waveform Graph1. The measurements are written in a file in continuous mode and read and shown in Graph 2 after everything is acquired. Please see my attached VI.

I am interested to find each wave's maximum value. Is it possible to use the "Array Max & Min" to find this value for each sensor? Please let me know how I can do that.

Your help would be greatly appreciated.

Download All
0 Kudos
Message 1 of 11
(3,303 Views)
Solution
Accepted by topic author niloofareli

The Array Min & Max will return the highest value of your array so if that is good enough for your application it'll work fine.

Your data is relatively noisy and some of the tops are flat so you may want to try the Peak Detector VI that offers you more advanced fitting options. That VI will not just return the peak sample value but estimates the positions and locations of your peaks.

 

From the Help:

This Peak Detector VI is based on an algorithm that fits a quadratic polynomial to sequential groups of data points. The number of data points used in the fit is specified by width.

0 Kudos
Message 2 of 11
(3,279 Views)

Thank you so much for your suggestion. Peak Detector VI is exactly what I need. 

Working on it, I don't understand why I can't get any results for #found, Locations and Amplitudes indicators. 

Would greatly appreciate your help!

0 Kudos
Message 3 of 11
(3,214 Views)

Sorry I am still unable to get the expected results from the peak detector. 

Please see the attached VI.

Thanks very much

0 Kudos
Message 4 of 11
(3,181 Views)

Please either attach the result TDMS file or save the graph data as default, save your VI and repost it.

0 Kudos
Message 5 of 11
(3,176 Views)

Please find the attached VI file.

Thank you very much.

Download All
0 Kudos
Message 6 of 11
(3,159 Views)
Solution
Accepted by topic author niloofareli

The main issue was that the 'waveform' you were analyzing only had three 'samples'.

You have to configure the Convert from Dynamic Data as explained on the diagram of the attached VI, otherwise you only get the first sample of your 3 waveforms (I know it's not obvious 🙂 )

Peak Detection on Noisy Data.jpg

Also the width value has to be much bigger in order to reject local maximum caused by noise. As you can see on the results the interpretation of the maximum for the first peak is debatable and chosing the array max value may as well be correct.

0 Kudos
Message 7 of 11
(3,148 Views)

Great! It makes perfect sense. Thank you so very much for your clear explanation. 

0 Kudos
Message 8 of 11
(3,130 Views)

Hi again,

Sorry for bothering you again. I have one more question. Trying to add 3 more waveforms to the graph, the peak detector only detects the peaks of the first wave. I want it to find the peaks of all 4 waveforms. Please see the attached VI and let me know what the problem is. 

Also regarding the curser in Waveform Graph 2, how can have it a horizental line similar to the attached "Peak Detection and Display" VI.

Thank you very much for your help. I really appreciate it.

 

0 Kudos
Message 9 of 11
(3,100 Views)

Sorry I forgot to attach the other VI.

0 Kudos
Message 10 of 11
(3,098 Views)