LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I determine if all values in a moving window/array are greater than x?

Solved!
Go to solution

@jcannon wrote:

 So for a 100 data point window, the outcome of the for loop with the 100 element subarray should be either 0 (1 or more elements DO NOT exceed the threshold) or 1 (ALL elements exceed the threshold).


Specifically, I would use "Array min&max ptbypt" with a sample lenght of 100, then compare the min with your threshold. If the min is larger, you got a match.

0 Kudos
Message 11 of 18
(1,569 Views)

Hi altenback,

 

This is a much simpler solution; but I cannot get it to work... I am doing something wrong with the autoindexing...?

 

Regards,

Jack

0 Kudos
Message 12 of 18
(1,544 Views)

Please attach your VI.

0 Kudos
Message 13 of 18
(1,542 Views)

Hmm... Had another quick play... Wires now seem happy to work?

 

I have it set-up as a subvi; so I the user can select the data of interest using the enum controls.

 

Do seem this look ok...?

 

Regards,

Jack

0 Kudos
Message 14 of 18
(1,536 Views)

Your VI has nothing to do with my suggestions. Please explain.

0 Kudos
Message 15 of 18
(1,528 Views)

The vi attached (MAW) uses a moving window approach (based on window length and step length controls) and determines if all data points within each window of after are greater than the threshold value and provided the index at which it occurs.... The MAW vi has other cases/controls added so that i can use it as a basic subvi and select what components of the data I want (e.g. just the first index that meet the set criteria, the first k number of indices, the last indices, etc, etc)

 

I have included the Array Min/Max function in the first for loop as this is where the data are compared against the set criteria...

 

Regards,

Jack

 

 

0 Kudos
Message 16 of 18
(1,511 Views)

Yes, I was just puzzled by my name in the Vi file name, because I suggested using a ptbypt version, which you don't use here.

 

(Doing a running measurement is not new and revolutionary, so there are existing well debugged and tested tools that you can use, eliminating knitting your own.)

0 Kudos
Message 17 of 18
(1,509 Views)

Ahhh... ptbypt... How did I not think that that? I use ptbypt functions in other aplications..

 

That would have saved me some hours!... Still so much to learn...

 

Thanks...

Jack

0 Kudos
Message 18 of 18
(1,507 Views)