Prachi Posted June 6, 2021 Share Posted June 6, 2021 Hi, I have 50 signals. I want to check if any of the signal has value 1. How can create new signal (or capsule) based on this check condition? Link to comment Share on other sites More sharing options...
Seeq Team Joe Reckamp Posted June 6, 2021 Seeq Team Share Posted June 6, 2021 Hi Prachi, A couple different options for you: Option 1 You're probably familiar that you can use Formula (or Value Search) with the following to create a capsule for when one signal is equal to 1: $signal==1 Therefore, one option is to combine this search together for each signal using the combinewith function: combinewith($signal1==1, $signal2==1, ... , $signal50==1) This will create a capsule for each signal equal to 1, which would result in multiple overlapped capsules if more than one signal was equal to 1. If you'd like to reduce that to create a capsule if "any" signal was 1, you could merge those together: combinewith($signal1==1, $signal2==1, ... , $signal50==1).merge() Alternately, if you want to know how many signals are equal to 1 at any point in time, you can use countoverlaps: combinewith($signal1==1, $signal2==1, ... , $signal50==1).countoverlaps() Option 2 Typically when counting 1 values, the signals are a 0/1 signal where it is 0 when inactive and 1 when active. If this is the case in your use case, an alternate approach could be to sum the signals and find when it is greater than or equal to 1: sum($signal1, $signal2, ... , $signal50) >= 1 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now