LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Find index of an array value greater than certain number

Solved!
Go to solution
Highlighted

Hello,

I am having a curve and I need a starting tangent of it, but random amount of values at start are useless so I need to find threshold, where the actual curve begins. For that purpose I built an array of the measured values and tried to find first value greater than certain number and it's index. I tried several ways to do that posted here on forum, but with no success.

I am having a LW 2009, could sb post a simplest possible VI that just finds first value in array greater than constant, and returns it's index?

And one minor question, is it better to build array of each value or just pull out graph history?

0 Kudos
Message 1 of 6
(130 Views)

"Threshold 1D array" does what you want.

 

If you by "graph history" mean to read the value of the graph, then yes that works just fine.



Certified LabVIEW Architect

G# - Award winning reference based OOP for LV, for free! VIPM Github
0 Kudos
Message 2 of 6
(116 Views)

Well, I tried that, but I am unsure how this will work on real data with some fluctuations (meaning not sorted).

0 Kudos
Message 3 of 6
(101 Views)

How about "greater than" in a for loop?



Certified LabVIEW Architect

G# - Award winning reference based OOP for LV, for free! VIPM Github
0 Kudos
Message 4 of 6
(96 Views)
Solution
Accepted by topic author Adalbertus
03-25-2019 06:11 AM

I will usually do a comparison of the array, then search the output array for instances of true.

 

Find Indices.png

 

0xDEAD

Message 5 of 6
(93 Views)

Tried for loop but the result was somewhat inconsistent, not sure what I've done wrong.

 

Will try the boolean array.

0 Kudos
Message 6 of 6
(84 Views)