LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

In an array, how do I search for "x" CONSECUTIVE elements above a cerain threshold?

I have an array of elements (read from a DAQ). I wish to detect when a certain THRESHOLD was crossed and maintained for "X" consecutive samples or x amount of time. The consecutive samples are so I don't get "flyers".
0 Kudos
Message 1 of 4
(3,235 Views)
Clint,
Your question is a good one. The problem you are facing can be solved using shift registers. I attached an example that does what you need, find peaks in a data array. As you will see, I use a shift register as a counter to count the number of samples in every peak sequence. If the number of samples is higher than the defined minimum value, the program considers it a peak and outputs the index for the first sample in a result array (the program can handle multiple peaks in an array. The VI is compatible with LabVIEW versions 4.1 and higher. I hope this helps. /Mikael Garcia
Message 2 of 4
(3,235 Views)
Mikael,
That worked like a charm !! I even modified it to work with "negative peaks".
Thanks !!
Clint
0 Kudos
Message 3 of 4
(3,235 Views)
Try this Vi (LV6.0)


--
Jerome LANGE
Strasbourg
andromed@club-internet.fr


"Clint Eastwood" a ?crit dans le message news:
5065000000080000006A4D0000-1023576873000@exchange.ni.com...
> I have an array of elements (read from a DAQ). I wish to detect when
> a certain THRESHOLD was crossed and maintained for "X" consecutive
> samples or x amount of time. The consecutive samples are so I don't
> get "flyers".



[Attachment lenght.vi, see below]
0 Kudos
Message 4 of 4
(3,235 Views)